/* Auth — stadium utility screen, shared with the product shell. */

.auth-page {
    position: relative;
    z-index: 1;
    display: grid;
    width: 100%;
    height: var(--app-visible-viewport-height, 100dvh);
    min-height: 0;
    max-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) clamp(16px, 4vw, 40px) max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    scroll-padding-block: 20px;
    box-sizing: border-box;
    align-items: safe center;
    justify-items: center;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(390px, 1.1fr);
    width: min(920px, 100%);
    min-height: 560px;
    overflow: hidden;
    border: 1px solid var(--product-line);
    border-radius: 14px;
    background: rgba(5, 10, 7, 0.97);
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.48);
}

.auth-brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 36px;
    border-right: 1px solid var(--product-line);
    background: rgba(12, 24, 17, 0.96);
}

.auth-brand-logo {
    display: block;
    width: min(100%, 300px);
    height: auto;
}

.auth-brand-rule {
    width: 52px;
    height: 3px;
    margin: 26px 0 16px;
    background: var(--product-green-hover);
}

.auth-brand-subtitle {
    margin: 0;
    color: #a9b7af;
    font-family: var(--font-tech);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.35;
    text-align: center;
    text-transform: uppercase;
}

.auth-content-panel {
    display: flex;
    min-width: 0;
    padding: 30px 36px 24px;
    flex-direction: column;
}

.auth-header-row {
    margin-bottom: 22px;
}

.auth-header-row .page-header-side.right {
    min-width: 48px;
}

.auth-title.app-page-title {
    font-size: clamp(1.65rem, 2.6vw, 2rem);
}

.auth-context {
    max-width: 46ch;
    margin: -8px 0 20px;
    color: #b4c0b9;
    font: 400 0.875rem/1.5 var(--font-body);
    text-wrap: pretty;
}

.auth-form-area,
.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-form-area {
    gap: 12px;
}

.auth-form {
    gap: 15px;
}

.auth-field-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}

.auth-field-group .app-field-label {
    color: #b4c0b9;
    text-transform: none;
}

.auth-field-hint {
    margin: 0;
    color: #b4c0b9;
    font: 400 0.875rem/1.45 var(--font-body);
    letter-spacing: 0;
    text-transform: none;
}

.auth-input.input-game {
    width: 100%;
    min-height: var(--product-control-regular);
    padding: 0 14px;
    box-sizing: border-box;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
}

.auth-input.input-game.invalid {
    border-color: rgba(255, 112, 106, 0.82) !important;
    box-shadow: 0 0 0 3px rgba(255, 96, 90, 0.13) !important;
}

.auth-submit-btn,
.auth-toggle-btn {
    width: 100%;
}

.auth-submit-btn {
    margin-top: 3px !important;
}

.auth-toggle-btn.app-secondary-action {
    font-family: var(--font-head);
    font-size: 0.9rem;
    font-style: italic;
}

.auth-inline-error {
    margin: -2px 0 0;
    padding: 9px 11px;
    border: 1px solid rgba(255, 112, 106, 0.28);
    border-radius: 9px;
    background: rgba(95, 25, 24, 0.28);
    color: #ffaaa6;
    font: 500 0.875rem/1.45 var(--font-body);
    letter-spacing: 0;
    text-align: left;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 20px;
}

.auth-lang-switch.app-segmented {
    width: 154px;
    flex: 0 0 auto;
}

.auth-lang-switch.app-segmented .lang-btn {
    min-height: var(--product-control-compact);
    padding: 0 10px;
    font-size: 0.875rem;
}

.auth-legal-links {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.auth-legal-links a {
    display: inline-flex;
    min-height: var(--product-control-compact);
    align-items: center;
    color: #b4c0b9;
    font: 500 0.875rem/1.35 var(--font-body);
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    transition: color 160ms var(--product-ease-out);
}

.auth-legal-links a:focus-visible {
    border-radius: 4px;
    outline: 3px solid var(--product-focus);
    outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
    .auth-legal-links a:hover {
        color: #f3f7f4;
    }
}

@media (max-width: 760px) {
    .auth-page {
        align-items: start;
        padding-inline: 14px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        width: min(520px, 100%);
        min-height: 0;
    }

    .auth-brand-panel {
        min-height: 102px;
        padding: 18px 24px;
        border-right: 0;
        border-bottom: 1px solid var(--product-line);
    }

    .auth-brand-logo {
        width: min(72%, 230px);
    }

    .auth-brand-rule,
    .auth-brand-subtitle {
        display: none;
    }

    .auth-content-panel {
        padding: 20px;
    }

    .auth-header-row {
        margin-bottom: 18px;
    }

    .auth-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
        padding-top: 16px;
    }

    .auth-lang-switch.app-segmented {
        width: 100%;
    }

    .auth-legal-links {
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .auth-page {
        padding-top: max(10px, env(safe-area-inset-top));
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .auth-brand-panel {
        min-height: 82px;
        padding: 14px 20px;
    }

    .auth-brand-logo {
        width: 188px;
    }

    .auth-content-panel {
        padding: 16px;
    }

    .auth-header-row {
        min-height: 48px;
        margin-bottom: 14px;
    }

    .auth-input.input-game {
        min-height: 48px;
    }

    .auth-form {
        gap: 11px;
    }

    .auth-form-area {
        gap: 10px;
    }
}

@media (max-width: 760px) {
    html:is(.app-keyboard-open, .app-short-viewport) .auth-page {
        align-items: start;
        padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
        scroll-padding-block: 12px 24px;
    }

    html:is(.app-keyboard-open, .app-short-viewport) .auth-brand-panel {
        min-height: 0;
        padding: 8px 16px;
    }

    html:is(.app-keyboard-open, .app-short-viewport) .auth-brand-logo {
        width: 112px;
    }

    html:is(.app-keyboard-open, .app-short-viewport) .auth-content-panel {
        padding: 8px 16px 12px;
    }

    html:is(.app-keyboard-open, .app-short-viewport) .auth-header-row {
        min-height: var(--product-control-compact);
        margin-bottom: 8px;
    }

    html:is(.app-keyboard-open, .app-short-viewport) .auth-context {
        margin: 0 0 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-legal-links a {
        transition: none;
    }
}
