/* =========================================================
   Reset & Base
   ========================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6f8;
    color: #222;
    line-height: 1.6;
}

/* =========================================================
   Layout
   ========================================================= */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.2rem;
}

main h1 {
    margin-bottom: 1rem;
}

/* =========================================================
   Header / Navigation
   ========================================================= */
.topbar {
    background: #1f2933;
    color: #fff;
}

.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 1.2rem;
}

nav a {
    color: #cfd8e3;
    text-decoration: none;
    margin-left: 1rem;
    font-size: 0.95rem;
}

nav a:hover {
    color: #fff;
}

nav a.admin {
    color: #f59e0b;
}

nav a.logout {
    color: #ef4444;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
    background: #e5e7eb;
    margin-top: 3rem;
    font-size: 0.85rem;
    color: #555;
}

/* =========================================================
   Content Wrapper (Vorschriften & Baureihen)
   ========================================================= */
.content-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.4rem 1.6rem;
    margin-top: 1.2rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.page-title {
    margin: 0 0 1rem;
    font-size: 1.2rem;
}

/* =========================================================
   Grid
   ========================================================= */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
}

/* =========================================================
   Vorschriften Cards
   ========================================================= */
.reg-card {
    display: block;
    background: #ffffff;
    border-radius: 14px;
    padding: 1.2rem 1.3rem;
    color: #111;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform .15s ease, box-shadow .15s ease;
}

.reg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
}

.reg-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .6rem;
}

.reg-card h2 {
    font-size: 1.05rem;
    margin: .3rem 0 .4rem;
    line-height: 1.3;
}

/* Badge */
.badge {
    padding: .25rem .55rem;
    font-size: .7rem;
    font-weight: 600;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #fff;
}

.badge.de { background: #2563eb; }
.badge.ch { background: #059669; }

.category {
    font-size: .75rem;
    color: #666;
    font-weight: 500;
}

.meta {
    font-size: .8rem;
    color: #555;
}

/* =========================================================
   Baureihen Cards
   ========================================================= */
.loco-card {
    background: #ffffff;
    border-radius: 14px;
    padding: .9rem;
    box-shadow: 0 4px 14px rgba(0,0,0,.05);
}

.loco-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: .6rem;
}

.doc-list {
    margin-top: .5rem;
    padding-left: 1rem;
}

.doc-list a {
    font-size: .85rem;
    color: #2563eb;
    text-decoration: none;
}

.doc-list a:hover {
    text-decoration: underline;
}

/* =========================================================
   Home Cards
   ========================================================= */
.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 1.4rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform .15s ease, box-shadow .15s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.1);
}

.card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.card.admin {
    border-left: 4px solid #f59e0b;
}

/* =========================================================
   Auth / Login
   ========================================================= */
.auth-wrapper {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2933 0%, #111827 100%);
}

.auth-card {
    position: relative;
    background: #ffffff;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #2563eb;
    border-radius: 12px 12px 0 0;
}

.auth-subtitle {
    margin-bottom: 1.5rem;
    color: #666;
    font-size: .95rem;
}

.auth-error {
    background: #fee2e2;
    color: #991b1b;
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .9rem;
}

.auth-success {
    background: #dcfce7;
    color: #166534;
    padding: .75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: .9rem;
}

/* Formular */
.auth-form .form-group {
    margin-bottom: 1.2rem;
}

.auth-form label {
    display: block;
    margin-bottom: .3rem;
    font-size: .85rem;
    color: #444;
}

.auth-form input,
select {
    width: 100%;
    padding: .6rem .7rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: .95rem;
}

.auth-form input:focus,
select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,.15);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    margin-top: 1rem;
    padding: .6rem 1.2rem;
    background: #2563eb;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
}

.btn-primary:hover {
    background: #1e4ed8;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 700px) {
    .topbar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        margin-top: .5rem;
    }

    nav a {
        margin: 0 .8rem 0 0;
    }
}
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: .8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #fff;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background .15s ease;
}

.back-btn:hover {
    background: rgba(255,255,255,0.18);
}
