/* Legends of Glory — Login & Register */
:root {
    --auth-gold: #c9a962;
    --auth-gold-bright: #e8d088;
    --auth-gold-dim: #8b6914;
    --auth-glass: rgba(8, 6, 4, 0.72);
    --auth-glass-border: rgba(201, 169, 98, 0.38);
    --auth-glass-highlight: rgba(255, 248, 235, 0.07);
    --auth-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
    --auth-font-display: 'Cinzel', Georgia, serif;
    --auth-font-ui: 'Outfit', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body.auth-page {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    font-family: var(--auth-font-ui);
    color: #e8dcc8;
    background: #030201;
    overflow-x: hidden;
}

.auth-scene {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-scene__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: center center / cover no-repeat;
    transform: scale(1.02);
    animation: authBgIn 1.2s ease-out both;
}

.auth-scene__overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 100% 70% at 50% 100%, rgba(0, 0, 0, 0.75) 0%, transparent 58%),
        radial-gradient(ellipse 80% 45% at 50% 0%, rgba(201, 169, 98, 0.1) 0%, transparent 52%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.28) 42%, rgba(0, 0, 0, 0.68) 100%);
}

@keyframes authBgIn {
    from { opacity: 0; transform: scale(1.06); }
    to { opacity: 1; transform: scale(1.02); }
}

.auth-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.auth-header {
    text-align: center;
    margin-bottom: clamp(20px, 4vh, 36px);
    animation: authFadeUp 0.7s ease-out both;
}

.auth-logo {
    width: min(320px, 78vw);
    height: auto;
    display: block;
    margin: 0 auto 12px;
    filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.75));
}

.auth-subtitle {
    margin: 0;
    font-family: var(--auth-font-display);
    font-size: clamp(0.82rem, 2.2vw, 1rem);
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--auth-gold-bright);
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: clamp(22px, 4vw, 32px);
    border-radius: 18px;
    border: 1px solid var(--auth-glass-border);
    background:
        linear-gradient(165deg, rgba(255, 248, 235, 0.06) 0%, transparent 40%),
        var(--auth-glass);
    backdrop-filter: blur(16px) saturate(1.12);
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
    box-shadow: var(--auth-shadow), inset 0 1px 0 var(--auth-glass-highlight);
    animation: authFadeUp 0.75s ease-out 0.1s both;
}

.auth-card::before {
    content: "";
    display: block;
    height: 1px;
    margin: -8px auto 18px;
    width: 55%;
    background: linear-gradient(90deg, transparent, rgba(232, 208, 136, 0.7), transparent);
}

.auth-card-title {
    margin: 0 0 18px;
    font-family: var(--auth-font-display);
    font-size: clamp(0.9rem, 2.4vw, 1.05rem);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
    color: var(--auth-gold-bright);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-reg-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(201, 169, 98, 0.92);
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
    width: 100%;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid rgba(201, 169, 98, 0.22);
    background: rgba(0, 0, 0, 0.48);
    color: #fff8ee;
    font-family: var(--auth-font-ui);
    font-size: clamp(0.86rem, 2vw, 0.94rem);
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.auth-field input::placeholder {
    color: rgba(232, 196, 168, 0.4);
}

.auth-field input:hover {
    border-color: rgba(201, 169, 98, 0.38);
    background: rgba(0, 0, 0, 0.55);
}

.auth-field input:focus {
    outline: none;
    border-color: rgba(232, 208, 136, 0.78);
    background: rgba(0, 0, 0, 0.62);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.16);
}

.auth-field-hp {
    position: absolute;
    left: -9999px;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.auth-forgot {
    margin-top: 6px;
    text-align: right;
    font-size: 0.72rem;
}

.auth-forgot a {
    color: var(--auth-gold-bright);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-forgot a:hover {
    color: #fff;
    text-decoration: underline;
}

.auth-submit {
    margin-top: 4px;
    width: 100%;
    padding: 13px 16px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(165deg, #e8d088 0%, #a8802a 48%, #8b6914 100%);
    color: #1a1008;
    font-family: var(--auth-font-display);
    font-size: clamp(0.72rem, 1.8vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.25);
}

.auth-submit:disabled:hover {
    transform: none;
    filter: grayscale(0.25);
}

.auth-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 10px;
    border: 1px solid var(--auth-glass-border);
    background: rgba(0, 0, 0, 0.35);
    color: var(--auth-gold-bright);
    font-family: var(--auth-font-ui);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.auth-btn-secondary:hover {
    background: rgba(201, 169, 98, 0.12);
    color: #fff;
}

.auth-msg {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.45;
    margin-bottom: 14px;
}

.auth-msg--error {
    color: #ffb8b8;
    background: rgba(80, 12, 12, 0.45);
    border: 1px solid rgba(200, 60, 60, 0.45);
}

.auth-msg--success {
    color: #b8f0c8;
    background: rgba(12, 60, 30, 0.45);
    border: 1px solid rgba(60, 180, 90, 0.4);
}

.auth-foot {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(201, 169, 98, 0.14);
    text-align: center;
    font-size: 0.78rem;
}

.auth-foot a {
    color: var(--auth-gold-bright);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-foot a:hover {
    color: #fff;
    text-decoration: underline;
}

.auth-lang {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.auth-lang a {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(201, 169, 98, 0.22);
    background: rgba(0, 0, 0, 0.32);
    color: rgba(232, 196, 168, 0.85);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-decoration: none;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.auth-lang a:hover {
    border-color: rgba(201, 169, 98, 0.5);
    color: var(--auth-gold-bright);
}

.auth-lang a.is-active {
    border-color: rgba(232, 208, 136, 0.75);
    background: rgba(201, 169, 98, 0.18);
    color: var(--auth-gold-bright);
}

.auth-social {
    position: fixed;
    top: clamp(14px, 2vh, 28px);
    right: clamp(14px, 2vw, 28px);
    z-index: 10;
    display: flex;
    gap: 14px;
    opacity: 0;
    animation: authFadeIn 0.8s ease-out 1.2s forwards;
}

.auth-social a {
    color: var(--auth-gold-bright);
    font-size: 1.45rem;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease, filter 0.2s ease;
}

.auth-social a:hover {
    color: #fff;
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(201, 169, 98, 0.6));
}

.auth-section-title {
    margin: clamp(28px, 5vh, 48px) 0 16px;
    font-family: var(--auth-font-display);
    font-size: clamp(0.95rem, 2.5vw, 1.15rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
    color: var(--auth-gold-bright);
    opacity: 0;
    animation: authFadeIn 0.8s ease-out 1.4s forwards;
}

.auth-features {
    display: flex;
    gap: clamp(20px, 4vw, 48px);
    padding: 0 clamp(12px, 4vw, 64px);
    max-width: 1100px;
    width: 100%;
    opacity: 0;
    animation: authFadeIn 0.8s ease-out 1.6s forwards;
}

.auth-feature {
    flex: 1;
    text-align: center;
}

.auth-feature-frame {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    min-height: 140px;
    border-radius: 12px;
    border: 1px solid var(--auth-glass-border);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.auth-feature-frame:hover {
    border-color: rgba(232, 208, 136, 0.55);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-3px);
}

.auth-feature-shot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    filter: brightness(0.72) saturate(0.92);
    transition: filter 0.25s ease, transform 0.25s ease;
}

.auth-feature-frame:hover .auth-feature-shot {
    filter: brightness(1) saturate(1);
    transform: scale(1.02);
}

.auth-legal {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
}

.auth-legal a {
    color: var(--auth-gold);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.auth-legal a:hover {
    opacity: 1;
    color: #fff;
}

.auth-referral {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(201, 169, 98, 0.35);
    background: rgba(201, 169, 98, 0.1);
    text-align: center;
    font-size: 0.82rem;
}

.auth-referral strong {
    display: block;
    margin-top: 4px;
    font-family: var(--auth-font-display);
    color: var(--auth-gold-bright);
    letter-spacing: 0.08em;
}

.auth-referral small {
    display: block;
    margin-top: 6px;
    color: rgba(232, 196, 168, 0.75);
    font-size: 0.72rem;
}

/* AGB-Bestätigung (Registrierung Schritt 2) */
.auth-page--agb .auth-header {
    margin-bottom: clamp(16px, 3vh, 28px);
}

.auth-container--agb {
    width: 100%;
    max-width: min(720px, 96vw);
}

.auth-agb-stage {
    width: 100%;
    animation: authFadeUp 0.75s ease-out 0.08s both;
}

.auth-agb-stage__card {
    width: 100%;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--auth-glass-border);
    background:
        linear-gradient(165deg, rgba(255, 248, 235, 0.06) 0%, transparent 38%),
        var(--auth-glass);
    backdrop-filter: blur(16px) saturate(1.12);
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
    box-shadow: var(--auth-shadow), inset 0 1px 0 var(--auth-glass-highlight);
}

.auth-agb-stage__card::before {
    content: "";
    display: block;
    height: 1px;
    margin: 0 auto;
    width: 55%;
    background: linear-gradient(90deg, transparent, rgba(232, 208, 136, 0.7), transparent);
}

.auth-agb-stage__title {
    margin: 0;
    padding: clamp(18px, 3vw, 22px) clamp(18px, 3vw, 24px) 14px;
    font-family: var(--auth-font-display);
    font-size: clamp(0.82rem, 2.2vw, 0.95rem);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
    color: var(--auth-gold-bright);
}

.auth-agb-stage__card .auth-msg {
    margin: 0 clamp(16px, 3vw, 22px) 12px;
}

.auth-agb-stage__scroll {
    margin: 0 clamp(14px, 2.5vw, 20px);
    height: min(52vh, 460px);
    border-radius: 12px;
    border: 1px solid rgba(201, 169, 98, 0.22);
    background: rgba(0, 0, 0, 0.55);
    overflow: hidden;
    box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.35);
}

.auth-agb-stage__scroll iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.auth-agb-stage__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(16px, 3vw, 20px) clamp(16px, 3vw, 22px) clamp(18px, 3vw, 22px);
    border-top: 1px solid rgba(201, 169, 98, 0.16);
    background: rgba(0, 0, 0, 0.28);
}

.auth-agb-stage__agree {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(201, 169, 98, 0.2);
    background: rgba(0, 0, 0, 0.32);
    color: rgba(232, 220, 200, 0.94);
    font-size: clamp(0.76rem, 1.9vw, 0.82rem);
    line-height: 1.45;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.auth-agb-stage__agree:hover {
    border-color: rgba(201, 169, 98, 0.38);
    background: rgba(0, 0, 0, 0.4);
}

.auth-agb-stage__agree input {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--auth-gold);
    cursor: pointer;
}

.auth-agb-stage__actions {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 10px;
}

.auth-agb-stage__cancel,
.auth-agb-stage__confirm {
    width: 100%;
    margin-top: 0;
}

.auth-agb-stage__cancel {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

@media (max-width: 520px) {
    .auth-agb-stage__actions {
        grid-template-columns: 1fr;
    }

    .auth-agb-stage__scroll {
        height: min(48vh, 380px);
    }
}

/* Legacy overlay (falls noch referenziert) */
.auth-agb-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.auth-agb-card {
    width: min(900px, 100%);
    max-height: min(92vh, 900px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--auth-glass-border);
    background: var(--auth-glass);
    box-shadow: var(--auth-shadow);
}

.auth-agb-header {
    padding: 16px 18px;
    font-family: var(--auth-font-display);
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--auth-gold-bright);
    border-bottom: 1px solid rgba(201, 169, 98, 0.18);
}

.auth-agb-body {
    height: min(58vh, 520px);
    background: #000;
}

.auth-agb-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.auth-agb-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(201, 169, 98, 0.18);
    background: rgba(0, 0, 0, 0.35);
}

.auth-agree {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    color: var(--auth-gold-bright);
    font-size: 0.78rem;
}

.auth-agree input {
    accent-color: var(--auth-gold);
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.88);
}

.auth-modal-content {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
}

.auth-modal-content img {
    max-width: 92vw;
    max-height: 92vh;
    display: block;
    border-radius: 10px;
    box-shadow: var(--auth-shadow);
}

.auth-modal-close {
    position: absolute;
    top: -36px;
    right: 0;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    line-height: 1;
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (min-width: 560px) {
    .auth-reg-grid {
        grid-template-columns: 1fr 1fr;
    }
    .auth-reg-grid .auth-field:first-child,
    .auth-reg-grid .auth-field:nth-child(2) {
        grid-column: 1 / -1;
    }
}

@media (max-width: 850px) {
    .auth-features {
        flex-direction: column;
    }
    .auth-social {
        top: 12px;
        right: 12px;
        gap: 10px;
    }
    .auth-social a {
        font-size: 1.2rem;
    }
}
