:root {
    --bg: #020617;
    --panel: rgba(255, 255, 255, 0.05);
    --panel2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.1);
    --text: #fff;
    --muted: #94a3b8;
    --blue: #3b82f6;
    --blue2: #60a5fa;
    --green: #6ee7b7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-page {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(70px);
}

.glow-1 {
    width: 390px;
    height: 390px;
    top: -140px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(59, 130, 246, 0.2);
}

.glow-2 {
    width: 320px;
    height: 320px;
    top: 260px;
    left: -110px;
    background: rgba(34, 211, 238, 0.1);
}

.glow-3 {
    width: 390px;
    height: 390px;
    right: -120px;
    bottom: 80px;
    background: rgba(139, 92, 246, 0.1);
}

.auth-container {
    width: min(100% - 32px, 1280px);
    min-height: 100vh;
    margin-inline: auto;
    display: flex;
    align-items: center;
    padding-block: 20px;
}

.auth-layout {
    width: 100%;
}

.auth-topbar {
    width: min(100% - 32px, 1280px);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    animation: authEnter 320ms ease both;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    text-decoration: none;
    transition: opacity 180ms ease, transform 180ms ease;
}

.auth-brand:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.auth-brand-logo {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #ffffff;
    color: #0f172a;
    font-size: 20px;
    font-weight: 950;
    box-shadow: 0 10px 28px rgba(255, 255, 255, 0.1);
}

.auth-brand-name {
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -0.025em;
}

.auth-grid {
    width: 100%;
    display: grid;
    gap: 24px;
}

.info-panel {
    display: none;
    animation: authEnter 320ms ease both;
}

.auth-card {
    width: min(100%, 448px);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 32px;
    background: var(--panel2);
    padding: 20px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    animation: authEnter 320ms ease both;
    animation-delay: 60ms;
}

.auth-switch {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px;
    margin-bottom: 20px;
}

.auth-switch a {
    flex: 1;
    border-radius: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 900;
    transition: 0.18s;
}

.auth-switch a:hover {
    color: #fff;
}

.auth-switch a.active {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.2);
}

.auth-title {
    margin: 0 0 20px;
    color: #fff;
    font-size: 28px;
    line-height: 1.15;
    letter-spacing: -0.04em;
    font-weight: 950;
}

.auth-form {
    flex-shrink: 0;
    display: grid;
    gap: 10px;
}

.auth-field {
    display: block;
}

.auth-field span {
    display: block;
    margin-bottom: 6px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 900;
}

.auth-field input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    outline: 0;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    transition: 0.18s;
}

.auth-field input:focus {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(15, 23, 42, 0.95);
}

.auth-field input.is-invalid {
    border-color: rgba(248, 113, 113, 0.42);
}

.auth-field-error {
    display: block;
    margin-top: 6px;
    color: #fda4af;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.45;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #94a3b8;
    font-size: 14px;
    padding-top: 4px;
}

.auth-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-row input,
.rules-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--blue);
}

.auth-link {
    border: 0;
    background: transparent;
    color: #93c5fd;
    font-weight: 800;
    padding: 0;
}

.auth-link:hover {
    color: #bfdbfe;
}

.auth-link[aria-disabled="true"] {
    cursor: default;
}

.rules-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.45;
    padding-top: 4px;
}

.rules-row input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.primary-button {
    width: 100%;
    border: 0;
    border-radius: 18px;
    background: var(--blue);
    color: #fff;
    margin-top: 12px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 950;
    box-shadow: 0 14px 34px rgba(59, 130, 246, 0.2);
    transition: 0.18s;
}

.primary-button:hover {
    background: var(--blue2);
}

.primary-button:active {
    transform: scale(0.99);
}

.primary-button:disabled {
    cursor: not-allowed;
    background: #334155;
    color: #94a3b8;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.secondary-button {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 950;
    text-decoration: none;
    transition: 0.18s;
}

.secondary-button:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.auth-bottom {
    flex-shrink: 0;
    margin-top: 20px;
}

.auth-bottom-compact {
    margin-top: 16px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-block: 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.social-button {
    display: flex;
    height: 56px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    transition: 0.18s;
}

.social-button:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.social-button svg {
    width: 28px;
    height: 28px;
}

.social-button.apple svg {
    width: 32px;
    height: 32px;
}

.auth-footnote {
    margin: 12px 0 0;
    color: #94a3b8;
    text-align: center;
    font-size: 14px;
}

.auth-footnote a {
    color: #93c5fd;
    font-weight: 900;
    text-decoration: none;
}

.auth-footnote a:hover {
    color: #bfdbfe;
}

.auth-description,
.auth-subtle {
    font-size: 14px;
    line-height: 1.7;
}

.auth-description {
    margin: 0 0 16px;
    color: #cbd5e1;
}

.auth-subtle {
    margin: 14px 0 16px;
    color: #94a3b8;
}

.auth-button-stack {
    display: grid;
    gap: 12px;
}

.auth-alert {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.auth-alert-error {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.28);
    color: #fecaca;
}

.auth-alert-warning {
    background: rgba(250, 204, 21, 0.12);
    border-color: rgba(250, 204, 21, 0.22);
    color: #fde68a;
}

.code-input {
    text-align: center;
    letter-spacing: 0.28em;
}

.info-heading {
    max-width: 600px;
    margin: 0;
    color: #fff;
    font-size: clamp(32px, 3.2vw, 40px);
    line-height: 1.08;
    letter-spacing: -0.045em;
    font-weight: 950;
}

.info-text {
    max-width: 520px;
    margin: 12px 0 0;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
}

.trust-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 32px;
    background: rgba(2, 6, 23, 0.52);
    padding: 16px;
}

.trust-card::before {
    content: "";
    position: absolute;
    right: 32px;
    top: 24px;
    width: 96px;
    height: 96px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.2);
    filter: blur(32px);
}

.trust-card::after {
    content: "";
    position: absolute;
    bottom: 16px;
    left: 40px;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.1);
    filter: blur(32px);
}

.trust-inner {
    position: relative;
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: center;
    gap: 16px;
}

.phone-animation {
    position: relative;
    display: flex;
    height: 112px;
    align-items: center;
    justify-content: center;
}

.phone-ping {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    animation: ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.phone-device {
    position: relative;
    display: flex;
    width: 56px;
    height: 80px;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    background: #0f172a;
    padding: 6px;
    box-shadow: 0 22px 50px rgba(59, 130, 246, 0.2);
    animation: pulse 1.8s ease-in-out infinite;
}

.phone-screen {
    height: 100%;
    border-radius: 14px;
    background: linear-gradient(135deg, #93c5fd, #f8fafc, #67e8f9);
}

.phone-home {
    width: 20px;
    height: 4px;
    margin: 4px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
}

.check-badge {
    position: absolute;
    top: 8px;
    right: -4px;
    display: flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: #34d399;
    color: #0f172a;
    font-size: 16px;
    font-weight: 950;
    box-shadow: 0 12px 30px rgba(52, 211, 153, 0.22);
    animation: bounce 1.4s infinite;
}

.trust-title {
    color: #bfdbfe;
    font-size: 14px;
    font-weight: 950;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.trust-text {
    margin: 8px 0 0;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.7;
}

.benefits-list {
    display: grid;
    gap: 8px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    padding: 12px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 800;
}

.benefit-icon {
    display: inline-flex;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(52, 211, 153, 0.15);
    color: var(--green);
    font-weight: 950;
}

body.page-leaving .auth-card,
body.page-leaving .info-panel,
body.page-leaving .auth-topbar {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

@keyframes ping {
    75%,
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.04);
    }
}

@keyframes bounce {
    0%,
    100% {
        transform: translateY(-12%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }

    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes authEnter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 1024px) {
    .auth-grid {
        grid-template-columns: 0.95fr 1.05fr;
        align-items: center;
    }

    .auth-grid-single {
        grid-template-columns: minmax(0, 448px);
        justify-content: center;
    }

    .info-panel {
        min-height: 790px;
        display: flex;
        flex-direction: column;
        gap: 24px;
        border: 1px solid var(--border);
        border-radius: 32px;
        background: var(--panel);
        padding: 28px;
        box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(20px);
    }

    .auth-card {
        padding: 24px;
    }
}

@media (max-width: 767px) {
    .auth-container {
        width: min(100% - 24px, 1280px);
        align-items: flex-start;
        padding-top: 28px;
        padding-bottom: 24px;
    }

    .auth-topbar {
        width: min(100% - 24px, 1280px);
        margin-bottom: 14px;
    }

    .auth-card {
        min-height: auto;
    }

    .auth-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

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

/* Light authentication pages */
:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --panel2: #ffffff;
    --border: #e2e5e9;
    --text: #172033;
    --muted: #687386;
    --blue: #2563eb;
    --blue2: #1d4ed8;
    --green: #15803d;
}

body {
    background: var(--bg);
    color: var(--text);
}

.auth-brand {
    color: var(--text);
}

.auth-brand-logo {
    border: 1px solid var(--border);
    background: #172033;
    color: #fff;
    box-shadow: none;
}

.auth-card,
.info-panel {
    border-color: var(--border);
    background: #fff;
    box-shadow: 0 12px 34px rgba(23, 32, 51, .08);
    backdrop-filter: none;
}

.auth-switch {
    border-color: var(--border);
    background: #eef2f7;
}

.auth-switch a {
    color: #687386;
}

.auth-switch a:hover {
    color: var(--text);
}

.auth-switch a.active {
    box-shadow: none;
}

.auth-title,
.auth-field span,
.info-title,
.feature-title {
    color: var(--text);
}

.auth-field input {
    border-color: #d8dde5;
    background: #f8fafc;
    color: var(--text);
}

.auth-field input:focus {
    border-color: #93b4f5;
    background: #fff;
}

.auth-row,
.rules-row,
.auth-description,
.auth-subtle,
.auth-footnote,
.info-description,
.feature-description {
    color: var(--muted);
}

.auth-field-error {
    color: #b42318;
}

.primary-button {
    box-shadow: none;
}

.primary-button:disabled {
    background: #d9dee7;
    color: #7b8494;
    box-shadow: none;
}

.secondary-button {
    border-color: var(--border);
    background: #fff;
    color: var(--text);
}

.secondary-button:hover {
    border-color: #b8c7df;
    background: #f8fafc;
}

.auth-alert-warning {
    border-color: #f2d08f;
    background: #fff8e8;
    color: #7a4b00;
}

@media (max-width: 767px) {
    .auth-card {
        border-radius: 22px;
        padding: 18px;
    }
}
