/* ===================================
   Auth — Modal + Nav Styles
   =================================== */

/* Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Modal */
.auth-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px 36px;
    position: relative;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s ease;
}

.auth-overlay.active .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.auth-close svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.auth-close:hover svg {
    color: var(--text-primary);
}

/* Forms */
.auth-form h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-field input,
.auth-field select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    /* HIGH-Fix iOS Safari Input-Zoom (< 16px triggert zoom-in beim Focus).
       Gilt jetzt auch für <select> (Länder-Dropdown reg-land) — vorher fiel
       das select auf den Browser-Default ~13px → iOS zoomte beim Antippen. */
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
}

/* Länder-Dropdown: eigener Pfeil + dunkle Optionen (sonst weiß-auf-weiß
   auf Windows-Chrome) + Touch-tauglich für Kevins 55+-Zielgruppe. */
.auth-field select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

.auth-field select option {
    background-color: #1a1a2e;
    color: #ffffff;
}

.auth-field input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.auth-field input:focus,
.auth-field select:focus {
    border-color: var(--accent);
    background: rgba(240, 136, 62, 0.04);
    box-shadow: 0 0 0 3px rgba(240, 136, 62, 0.1);
}

.auth-error {
    font-size: 13px;
    color: #ef4444;
    min-height: 20px;
    margin-bottom: 8px;
}

.auth-success {
    font-size: 14px;
    color: #c8551a;
    background: rgba(240, 136, 62, 0.08);
    border: 1px solid rgba(240, 136, 62, 0.25);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    line-height: 1.45;
}

.auth-form .btn-block {
    margin-top: 8px;
}

.auth-forgot {
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
}

.auth-forgot a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.auth-forgot a:hover {
    color: var(--accent-light);
    text-decoration: underline;
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 20px;
}

.auth-switch a {
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Nav auth element */
.auth-nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
}

.auth-nav-user svg {
    color: var(--accent-light);
}

.auth-nav-account {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

.auth-nav-account:hover {
    color: var(--accent-light);
}

.auth-nav-logout {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.auth-nav-logout svg {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.auth-nav-logout:hover svg {
    color: #ef4444;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* Mobile auth button (next to hamburger) */
.auth-nav-mobile {
    display: none;
    align-items: center;
}

.auth-mobile-login-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.auth-mobile-login-btn:hover {
    border-color: rgba(240, 136, 62, 0.4);
    background: rgba(240, 136, 62, 0.08);
}

.auth-mobile-login-btn svg {
    color: var(--text-primary);
}

.auth-nav-user--mobile {
    gap: 4px;
}

.auth-nav-user--mobile > svg {
    color: var(--accent-light);
}

body.is-authenticated a[href="/probetraining"],
body.is-authenticated a[href="/probetraining.html"],
body.is-authenticated a[href="probetraining.html"],
body.is-authenticated a[href="./probetraining.html"] {
    display: none !important;
}

/* Gleicher Umschaltpunkt wie das Burger-Menü in main.css (1024 px). */
@media (max-width: 1024px) {
    .auth-nav-mobile {
        display: flex;
    }

    .nav-right-mobile {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .auth-nav-user--mobile {
        gap: 2px;
    }

    .auth-nav-user--mobile .auth-nav-account,
    .auth-nav-user--mobile .auth-nav-logout {
        width: 34px;
        height: 34px;
        padding: 0;
        justify-content: center;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

/* Training Auth Gate */
.training-auth-gate {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    background: rgba(10, 10, 15, 0.6);
}

.training-auth-gate-inner {
    max-width: 480px;
    width: 100%;
    padding: 48px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.training-auth-gate-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(240, 136, 62, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border: 1px solid rgba(240, 136, 62, 0.2);
}

.training-auth-gate-icon svg {
    width: 36px;
    height: 36px;
    color: var(--accent-light);
}

.training-auth-gate-inner h2 {
    font-size: 26px;
    font-weight: 700;
}

.training-auth-gate-inner p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 360px;
}

.training-auth-gate-btns {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Register Code Question */
.auth-code-prompt {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.auth-code-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.auth-code-divider::before,
.auth-code-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

.auth-code-divider span {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-no-code-box {
    padding: 20px;
    border-radius: var(--radius-md);
    text-align: center;
}

.auth-no-code-box p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.auth-no-code-box p strong {
    color: var(--text-primary);
}

.auth-no-code-box .btn {
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* Register form rows */
.auth-field-row {
    display: flex;
    gap: 12px;
}

.auth-field-row .auth-field {
    flex: 1;
}

.auth-section-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 20px 0;
}

/* Checkbox label */
.auth-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.5;
}

.auth-checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.auth-checkbox-label a {
    color: var(--accent-light);
    text-decoration: none;
}

.auth-checkbox-label a:hover {
    text-decoration: underline;
}

.required {
    color: #ef4444;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        max-width: calc(100% - 32px);
        padding: 32px 24px;
    }

    .auth-form h2 {
        font-size: 20px;
    }

    .auth-field-row {
        flex-direction: column;
        gap: 0;
    }

    .auth-field-row .auth-field {
        flex: 1 1 auto !important;
    }
}
/* Login-Zustaende werden zentral von auth-ui.js gesetzt. Das explizite
   hidden gewinnt auch gegen mobile Navigations-Layouts. */
.lsp-member-nav[hidden],
[data-auth-member][hidden],
[data-auth-guest][hidden] {
    display: none !important;
}

.lsp-member-nav a {
    white-space: nowrap;
}
