/* =========================================
   AUTH LAYOUT — Login / Forgot / Reset
   ========================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1e293b;
}

/* ---- Vollbild-Background ---- */
.auth-body {
    min-height: 100vh;
    background-image: url('../img/snow-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

/* Dunkles Overlay damit das Formular gut lesbar ist */
.auth-body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    z-index: 0;
}

/* ---- Login-Card ---- */
.auth-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-card__logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.auth-card__logo {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-card__logo img {
    display: inline-block;
}

.auth-card__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.5rem;
}

.auth-card__sub {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1.25rem;
    margin-top: -1rem;
}

/* ---- Formular ---- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.auth-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.auth-input {
    padding: 0.65rem 0.875rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

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

/* ---- Remember-me ---- */
.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-remember input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
}

.auth-remember label {
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

/* ---- Submit-Button ---- */
.auth-btn {
    padding: 0.7rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
    margin-top: 0.25rem;
}

.auth-btn:hover { background: #1d4ed8; }
.auth-btn:active { background: #1e40af; }

/* ---- Link (Passwort vergessen / Zurück) ---- */
.auth-link {
    text-align: center;
    font-size: 0.875rem;
    color: #2563eb;
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

/* ---- Flash-Nachricht ---- */
.auth-flash {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    max-width: calc(100vw - 2rem);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

.auth-flash--success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.auth-flash--error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.auth-flash--info    { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }

/* ---- Dark Mode (Browser-Präferenz) ---- */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(30, 41, 59, 0.97);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    }

    .auth-card__title { color: #f1f5f9; }

    .auth-card__sub { color: #94a3b8; }

    .auth-field label { color: #cbd5e1; }

    .auth-input {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }

    .auth-input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
    }

    .auth-input::placeholder { color: #475569; }

    .auth-remember label { color: #94a3b8; }

    .auth-flash--success { background: #14532d; color: #86efac; border-color: #16a34a; }
    .auth-flash--error   { background: #7f1d1d; color: #fca5a5; border-color: #dc2626; }
    .auth-flash--info    { background: #0c4a6e; color: #7dd3fc; border-color: #0891b2; }
}

/* ---- Mobile ---- */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.25rem;
        border-radius: 12px;
    }
}

/* ---- Toast ---- */
.toast-container {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    animation: toastIn .2s ease;
    pointer-events: all;
    max-width: 360px;
    text-align: center;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.toast-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.toast-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; }
.toast-info    { background: #e0f2fe; color: #0369a1; border: 1px solid #7dd3fc; }
.toast-warning { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }
