/* ============================================================
   CultureTogether – Auth Pages (Login / Registrierung / Verify)
   WCAG 2.1 Level AA/AAA konform
   ============================================================ */

/* ── Seiten-Wrapper ─────────────────────────────────────── */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 2rem 1rem;
    background-color: #f4f6f9;
}

/* ── Card ───────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.09);
    padding: 2.5rem 2.25rem;
}

.auth-card--verify {
    text-align: center;
    max-width: 500px;
}

/* ── Verify Icon ────────────────────────────────────────── */
.auth-verify__icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
    color: var(--color-primary, #1a73e8);
}

/* ── Card Header ────────────────────────────────────────── */
.auth-card__header {
    margin-bottom: 1.75rem;
    text-align: center;
}

.auth-card__title {
    font-size: 1.625rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}

.auth-card__subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.55;
}

/* ── Hinweis-Box ────────────────────────────────────────── */
.auth-card__notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.auth-card__notice--success {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* ── Fehler-Box (WCAG 3.3.1) ────────────────────────────── */
.auth-card__errors {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.auth-card__errors-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.auth-card__errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.auth-card__errors li {
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

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

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

.auth-form__label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* WCAG 1.3.1 – Label sichtbar und mit Input verbunden */
.auth-form__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
}

.auth-form__required {
    color: #dc2626;
    margin-left: 0.15em;
}

/* WCAG 1.4.3 – Kontrastverhältnis ≥ 4.5:1 für Text */
.auth-form__input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    /* WCAG 2.5.3 – Mindest-Trefferzone */
    min-height: 48px;
}

.auth-form__input::placeholder {
    color: #9ca3af;
}

/* WCAG 2.4.7 – Sichtbarer Fokus */
.auth-form__input:focus {
    outline: none;
    border-color: var(--color-primary, #1a73e8);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.25);
}

/* WCAG 1.4.1 – Nicht nur Farbe als Fehlerkennzeichnung → auch Rahmen-Icon */
.auth-form__input.is-invalid {
    border-color: #dc2626;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
    background-size: 1rem;
    padding-right: 2.75rem;
}

.auth-form__input.is-invalid:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.auth-form__error {
    font-size: 0.8125rem;
    color: #dc2626;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.auth-form__hint {
    font-size: 0.8125rem;
    color: #6b7280;
}

.auth-form__forgot {
    font-size: 0.8125rem;
    color: var(--color-primary, #1a73e8);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-form__forgot:hover {
    text-decoration: none;
}

/* ── Passwort-Wrapper + Toggle ───────────────────────────── */
.auth-form__password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-form__password-wrap .auth-form__input {
    padding-right: 3rem;
}

.auth-form__password-toggle {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* WCAG 2.5.5 / 2.5.8 – Trefferzone ≥ 24px */
    min-width: 32px;
    min-height: 32px;
    transition: color 0.15s ease;
}

.auth-form__password-toggle:hover {
    color: #111827;
}

/* WCAG 2.4.7 – sichtbarer Fokus */
.auth-form__password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.35);
    color: var(--color-primary, #1a73e8);
}

/* ── Checkbox ────────────────────────────────────────────── */
.auth-form__group--checkbox {
    gap: 0.375rem;
}

/* Äußere Karte */
.auth-form__checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.auth-form__checkbox-wrap:hover {
    border-color: var(--color-primary, #1a73e8);
    background: #eff6ff;
}

/* Karte im Fehlerzustand */
.auth-form__checkbox-wrap.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
}

/* Karte wenn Checkbox angehakt ist */
.auth-form__checkbox-wrap:has(.auth-form__checkbox:checked) {
    border-color: var(--color-primary, #1a73e8);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

/* Nativer Input – visuell unsichtbar, aber für AT und Tastatur erreichbar */
.auth-form__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Label nimmt die gesamte Karte als Klickziel */
.auth-form__checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #374151;
    width: 100%;
    /* WCAG 2.5.3 – Mindest-Trefferzone */
    min-height: 44px;
}

/* Benutzerdefinierte Checkbox-Box */
.auth-form__checkbox-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}

/* Häkchen – anfangs unsichtbar */
.auth-form__checkbox-box svg {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s, transform 0.15s;
    color: #fff;
    pointer-events: none;
}

/* Geprüft-Zustand */
.auth-form__checkbox:checked + .auth-form__checkbox-label .auth-form__checkbox-box {
    background: var(--color-primary, #1a73e8);
    border-color: var(--color-primary, #1a73e8);
}

.auth-form__checkbox:checked + .auth-form__checkbox-label .auth-form__checkbox-box svg {
    opacity: 1;
    transform: scale(1);
}

/* Fehlerzustand – Box rot umrahmen */
.auth-form__checkbox-wrap.is-invalid .auth-form__checkbox-box {
    border-color: #dc2626;
}

/* WCAG 2.4.7 – sichtbarer Tastaturfokus */
.auth-form__checkbox:focus-visible + .auth-form__checkbox-label .auth-form__checkbox-box {
    outline: 3px solid var(--color-primary, #1a73e8);
    outline-offset: 2px;
}

/* Link im Checkbox-Text */
.auth-form__checkbox-label .auth-form__link {
    color: var(--color-primary, #1a73e8);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
}

.auth-form__checkbox-label .auth-form__link:hover {
    text-decoration: none;
}

.auth-form__checkbox-label .auth-form__link:focus-visible {
    outline: 2px solid var(--color-primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Submit-Button ───────────────────────────────────────── */
/* WCAG 1.4.3 – Kontrastverhältnis #ffffff auf #1a73e8 ≈ 4.7:1 ✓ */
.auth-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background-color: var(--color-primary, #1a73e8);
    border: 2px solid var(--color-primary, #1a73e8);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.1s ease;
    /* WCAG 2.5.5 / 2.5.8 – Trefferzone */
    min-height: 48px;
    margin-top: 0.5rem;
}

.auth-form__submit:hover {
    background-color: #1558b0;
    border-color: #1558b0;
}

.auth-form__submit:active {
    transform: translateY(1px);
}

.auth-form__submit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.4);
}

/* Outline-Variante (für Verify-Seite) */
.auth-form__submit--outline {
    background-color: #ffffff;
    color: var(--color-primary, #1a73e8);
    border-color: var(--color-primary, #1a73e8);
}

.auth-form__submit--outline:hover {
    background-color: #eff6ff;
    border-color: #1558b0;
    color: #1558b0;
}

/* ── Switch-Link (Login ↔ Registrieren) ─────────────────── */
.auth-card__switch {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
    margin: 1.5rem 0 0;
}

.auth-card__switch-link {
    color: var(--color-primary, #1a73e8);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-card__switch-link:hover {
    text-decoration: none;
}

.auth-card__switch-link:focus-visible {
    outline: 2px solid var(--color-primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── Verify-spezifisch ───────────────────────────────────── */
.auth-verify__hint {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1.25rem;
    text-align: center;
}

.auth-verify__form {
    margin-bottom: 1rem;
}

.auth-verify__logout {
    text-align: center;
}

.auth-verify__logout-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: #6b7280;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0.5rem;
    border-radius: 4px;
    min-height: 44px;
}

.auth-verify__logout-btn:hover {
    color: #374151;
    text-decoration: none;
}

.auth-verify__logout-btn:focus-visible {
    outline: 2px solid var(--color-primary, #1a73e8);
    outline-offset: 2px;
}

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

    .auth-card__title {
        font-size: 1.375rem;
    }
}
