/* SubTube authentication pages — intentionally scoped to .auth-page. */

.auth-page {
    --auth-panel: rgba(13, 23, 42, 0.92);
    --auth-panel-soft: rgba(25, 36, 57, 0.7);
    --auth-border: rgba(139, 157, 187, 0.22);
    --auth-border-strong: rgba(167, 139, 250, 0.56);
    --auth-muted: #9aa8bc;
    --auth-purple: #8b5cf6;
    --auth-purple-bright: #a78bfa;
    --auth-cyan: #55d7ff;
}

.auth-page .app-sidebar,
.auth-page .app-mobile-nav,
.auth-page #scrollTopBtn {
    display: none !important;
}

.auth-page .app-topbar {
    border-bottom-color: rgba(120, 140, 173, 0.18);
    background: rgba(7, 16, 34, 0.86);
}

.auth-page .app-topbar-actions {
    visibility: hidden;
}

.auth-page .app-main-column {
    margin-left: 0;
}

.auth-page .app-main {
    display: flex;
    min-height: calc(100vh - var(--st-topbar-height));
    padding: clamp(32px, 6vh, 72px) clamp(20px, 5vw, 72px);
    align-items: center;
    background:
        radial-gradient(circle at 18% 22%, rgba(85, 215, 255, 0.08), transparent 24rem),
        radial-gradient(circle at 78% 12%, rgba(139, 92, 246, 0.12), transparent 28rem);
}

.auth-page .app-flash-stack {
    position: absolute;
    z-index: 2;
    top: calc(var(--st-topbar-height) + 16px);
    left: 50%;
    width: min(680px, calc(100% - 32px));
    transform: translateX(-50%);
}

.auth-layout {
    display: grid;
    width: min(1080px, 100%);
    margin: 0 auto;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 470px);
    gap: clamp(48px, 8vw, 112px);
    align-items: center;
}

.auth-story {
    max-width: 520px;
}

.auth-eyebrow {
    display: inline-flex;
    margin: 0 0 18px;
    gap: 8px;
    align-items: center;
    color: var(--auth-purple-bright);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.auth-story h1 {
    max-width: 520px;
    margin: 0;
    color: #fff;
    font-size: clamp(2.3rem, 4.4vw, 4.15rem);
    font-weight: 850;
    letter-spacing: -0.055em;
    line-height: 1.09;
}

.auth-story-lead {
    max-width: 480px;
    margin: 24px 0 0;
    color: #a9b5c7;
    font-size: clamp(0.96rem, 1.3vw, 1.08rem);
    line-height: 1.85;
}

.auth-feature-list {
    display: grid;
    margin: 34px 0 0;
    padding: 0;
    gap: 14px;
    list-style: none;
}

.auth-feature-list li {
    display: flex;
    gap: 12px;
    align-items: center;
    color: #d8e0ec;
    font-size: 0.9rem;
    font-weight: 650;
}

.auth-feature-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(139, 92, 246, 0.26);
    border-radius: 10px;
    color: var(--auth-purple-bright);
    background: rgba(139, 92, 246, 0.1);
}

.auth-card-column {
    width: 100%;
}

.auth-card {
    position: relative;
    width: 100%;
    padding: clamp(26px, 4vw, 42px);
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(17, 29, 52, 0.96), var(--auth-panel));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.auth-card::before {
    position: absolute;
    top: -100px;
    right: -86px;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    filter: blur(2px);
    content: "";
    pointer-events: none;
}

.auth-card-header {
    position: relative;
    margin-bottom: 28px;
}

.auth-card-kicker {
    display: inline-flex;
    min-height: 30px;
    margin-bottom: 14px;
    padding: 5px 10px;
    gap: 7px;
    align-items: center;
    border: 1px solid rgba(139, 92, 246, 0.24);
    border-radius: 999px;
    color: var(--auth-purple-bright);
    background: rgba(139, 92, 246, 0.09);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.auth-card h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.62rem, 3vw, 2rem);
    font-weight: 820;
    letter-spacing: -0.035em;
}

.auth-card-header p {
    margin: 9px 0 0;
    color: var(--auth-muted);
    font-size: 0.86rem;
    line-height: 1.65;
}

.auth-form {
    position: relative;
    display: grid;
    gap: 19px;
}

.auth-field {
    display: grid;
    gap: 8px;
}

.auth-field-heading {
    display: flex;
    min-height: 22px;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.auth-field label {
    color: #e8edf5;
    font-size: 0.82rem;
    font-weight: 720;
}

.auth-field-hint,
.auth-form-note {
    margin: 0;
    color: #7f8da3;
    font-size: 0.72rem;
    line-height: 1.55;
}

.auth-input-shell {
    position: relative;
    display: flex;
    min-height: 52px;
    align-items: center;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: rgba(5, 13, 28, 0.58);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-input-shell:focus-within {
    border-color: var(--auth-border-strong);
    background: rgba(8, 16, 33, 0.9);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.14);
}

.auth-input-icon {
    position: absolute;
    left: 15px;
    color: #74839b;
    font-size: 1rem;
    pointer-events: none;
}

.auth-input-shell input {
    width: 100%;
    min-height: 50px;
    padding: 12px 46px 12px 44px;
    border: 0;
    outline: 0;
    color: #f8fafc;
    background: transparent;
    font-size: 0.94rem;
}

.auth-input-shell input::placeholder {
    color: #647289;
    opacity: 1;
}

.auth-input-shell input:-webkit-autofill,
.auth-input-shell input:-webkit-autofill:hover,
.auth-input-shell input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc;
    box-shadow: 0 0 0 1000px #0b1426 inset;
}

.auth-password-toggle {
    position: absolute;
    right: 4px;
    display: inline-grid;
    width: 44px;
    height: 44px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: #8f9db1;
    background: transparent;
}

.auth-password-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.055);
}

.auth-primary-button,
.auth-google-button {
    display: inline-flex;
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    gap: 10px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 780;
    text-decoration: none;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.auth-primary-button {
    border: 1px solid rgba(167, 139, 250, 0.52);
    color: #fff;
    background: linear-gradient(135deg, #7144e8, #8b5cf6);
    box-shadow: 0 12px 28px rgba(112, 68, 232, 0.24);
}

.auth-primary-button:hover:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg, #7c50ee, #9668fa);
    box-shadow: 0 15px 32px rgba(112, 68, 232, 0.32);
    transform: translateY(-1px);
}

.auth-google-button {
    border: 1px solid var(--auth-border);
    color: #edf2f8;
    background: rgba(255, 255, 255, 0.035);
}

.auth-google-button:hover:not(:disabled) {
    border-color: rgba(139, 157, 187, 0.38);
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
}

.auth-primary-button:disabled,
.auth-google-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.auth-button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.34);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.75s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.auth-divider {
    display: flex;
    margin: 3px 0;
    gap: 12px;
    align-items: center;
    color: #68778e;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
    height: 1px;
    flex: 1;
    background: rgba(139, 157, 187, 0.16);
    content: "";
}

.auth-text-button {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 4px;
    border: 0;
    color: var(--auth-purple-bright);
    background: transparent;
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-text-button:hover {
    color: #c4b5fd;
    text-decoration: underline;
}

.auth-card-footer {
    margin: 24px 0 0;
    color: var(--auth-muted);
    font-size: 0.8rem;
    line-height: 1.65;
    text-align: center;
}

.auth-card-footer a {
    display: inline-flex;
    min-height: 44px;
    padding: 8px 4px;
    align-items: center;
    color: var(--auth-purple-bright) !important;
    font-weight: 760;
    text-decoration: none;
}

.auth-card-footer a:hover {
    color: #c4b5fd !important;
    text-decoration: underline;
}

.auth-alert,
.auth-status,
.auth-preview-notice {
    position: relative;
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.6;
}

.auth-alert {
    border: 1px solid rgba(251, 113, 133, 0.28);
    color: #fecdd3;
    background: rgba(159, 18, 57, 0.18);
}

.auth-status {
    border: 1px solid rgba(57, 211, 152, 0.26);
    color: #bbf7d0;
    background: rgba(6, 95, 70, 0.18);
}

.auth-preview-notice {
    display: flex;
    margin-top: -4px;
    gap: 11px;
    align-items: flex-start;
    border: 1px solid rgba(85, 215, 255, 0.24);
    color: #c9efff;
    background: rgba(14, 116, 144, 0.14);
}

.auth-preview-notice i {
    margin-top: 2px;
    color: var(--auth-cyan);
    font-size: 1rem;
}

.auth-preview-notice span {
    display: grid;
    gap: 2px;
}

.auth-preview-notice strong {
    color: #ecfeff;
}

.auth-page .auth-text-button:disabled {
    cursor: not-allowed;
    opacity: 0.46;
    text-decoration: none;
}

.auth-terms {
    display: grid;
    min-height: 48px;
    margin: 1px 0 0;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
    color: #aeb9c9;
    font-size: 0.77rem;
    line-height: 1.65;
}

.auth-terms input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    border: 1px solid #526179;
    border-radius: 5px;
    accent-color: var(--auth-purple);
}

.auth-terms label {
    cursor: pointer;
}

.auth-terms a {
    color: var(--auth-purple-bright) !important;
    font-weight: 680;
    text-underline-offset: 3px;
}

.auth-legal-note {
    margin: 16px 0 0;
    color: #748298;
    font-size: 0.68rem;
    line-height: 1.6;
    text-align: center;
}

.auth-page :where(button, input, a):focus-visible {
    outline: 3px solid rgba(85, 215, 255, 0.56);
    outline-offset: 2px;
}

@media (max-width: 900px) {
    .auth-page .app-main {
        padding-top: 36px;
        align-items: flex-start;
    }

    .auth-layout {
        max-width: 520px;
        grid-template-columns: 1fr;
        gap: 28px;
    }

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

    .auth-story h1,
    .auth-story-lead {
        margin-right: auto;
        margin-left: auto;
    }

    .auth-story h1 {
        font-size: clamp(2rem, 7vw, 2.65rem);
    }

    .auth-story-lead {
        margin-top: 14px;
    }

    .auth-feature-list {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .auth-page .app-topbar {
        padding: 0 15px;
    }

    .auth-page .app-brand-logo {
        width: 136px;
        height: 40px;
    }

    .auth-page .app-main {
        min-height: auto;
        padding: 24px 14px 38px;
    }

    .auth-story {
        text-align: left;
    }

    .auth-story h1 {
        font-size: clamp(1.85rem, 9vw, 2.25rem);
    }

    .auth-story-lead {
        margin-top: 12px;
        font-size: 0.88rem;
        line-height: 1.7;
    }

    .auth-eyebrow {
        margin-bottom: 12px;
        font-size: 0.64rem;
    }

    .auth-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .auth-card-header {
        margin-bottom: 24px;
    }

    .auth-form {
        gap: 17px;
    }

    .auth-page .app-footer-inner {
        padding-right: 18px;
        padding-bottom: 24px;
        padding-left: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
