:root {
    --font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Space Grotesk", "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --primary: #009BD7;
    --primary-2: #0087bd;
    --accent: #009BD7;
    --success: #059669;
    --warning: #d97706;
    --danger: #e11d48;
    --radius-card: 16px;
    --radius-field: 11px;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #ffffff;
    --bg-glow-a: transparent;
    --bg-glow-b: transparent;
    --card: #f5f5f5;
    --text: #111111;
    --text-soft: rgba(17, 17, 17, 0.72);
    --muted: rgba(17, 17, 17, 0.56);
    --border: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.2);
    --input-bg: #ffffff;
    --input-border: #d5dce8;
    --ring: rgba(0, 155, 215, 0.2);
    --tab-bg: #e8e8e8;
    --tab-active: #ffffff;
    --tab-shadow: 0 2px 8px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 24px 60px -20px rgba(30, 41, 99, 0.22);
    --shadow-lg: 0 18px 50px -12px rgba(15, 23, 42, 0.28);
    --primary-glow: rgba(0, 155, 215, 0.45);
    --danger-bg: #fff1f3;
    --danger-border: #fecdd3;
    --danger-text: #be123c;
    --danger-ring: rgba(225, 29, 72, 0.14);
    --info-bg: #e6f6fd;
    --info-border: #b3e2f5;
    --info-text: #00709b;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #047857;
    --toast-bg: #ffffff;
    --toast-border: rgba(15, 23, 42, 0.08);
    --toast-text: #111111;
    --sk-a: #eceff5;
    --sk-b: #f6f8fb;
    --overlay: rgba(15, 23, 42, 0.45);
    --busy-bg: rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #121212;
    --bg-glow-a: transparent;
    --bg-glow-b: transparent;
    --card: #1e1e1e;
    --text: #ffffff;
    --text-soft: rgba(255, 255, 255, 0.72);
    --muted: rgba(255, 255, 255, 0.56);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.18);
    --input-bg: rgba(255, 255, 255, 0.04);
    --input-border: rgba(255, 255, 255, 0.14);
    --ring: rgba(0, 155, 215, 0.3);
    --tab-bg: rgba(255, 255, 255, 0.06);
    --tab-active: rgba(255, 255, 255, 0.12);
    --tab-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 30px 70px -20px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 18px 50px -12px rgba(0, 0, 0, 0.7);
    --primary: #009BD7;
    --primary-2: #0087bd;
    --primary-glow: rgba(0, 155, 215, 0.45);
    --danger: #fb7185;
    --danger-bg: rgba(244, 63, 94, 0.12);
    --danger-border: rgba(251, 113, 133, 0.3);
    --danger-text: #fda4af;
    --danger-ring: rgba(251, 113, 133, 0.2);
    --info-bg: rgba(0, 155, 215, 0.12);
    --info-border: rgba(0, 155, 215, 0.32);
    --info-text: #7fd0ef;
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.12);
    --success-border: rgba(52, 211, 153, 0.3);
    --success-text: #6ee7b7;
    --warning: #fbbf24;
    --toast-bg: #1e1e1e;
    --toast-border: rgba(255, 255, 255, 0.1);
    --toast-text: #f1f5f9;
    --sk-a: rgba(255, 255, 255, 0.06);
    --sk-b: rgba(255, 255, 255, 0.12);
    --overlay: rgba(2, 6, 18, 0.65);
    --busy-bg: rgba(10, 15, 28, 0.78);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    max-width: 100%;
    overflow-x: clip;
}

html.modal-open,
html.modal-open body {
    overflow: hidden;
}

body {
    margin: 0;
    max-width: 100%;
    overflow-x: clip;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

button,
input {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: none;
}

button:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    animation: focus-pulse 1.5s ease-in-out infinite;
}

a:focus-visible {
    border-radius: 4px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ic {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.page {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

.brand-panel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: #1e1e1e;
    color: #fff;
    display: flex;
}

.aurora {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.28;
    will-change: transform;
}

.blob-a {
    width: 520px;
    height: 520px;
    left: -140px;
    top: -120px;
    background: radial-gradient(circle at 30% 30%, #009BD7, transparent 70%);
    animation: drift-a 22s ease-in-out infinite alternate;
}

.blob-b {
    width: 480px;
    height: 480px;
    right: -160px;
    bottom: -140px;
    background: radial-gradient(circle at 60% 60%, #009BD7, transparent 70%);
    animation: drift-b 26s ease-in-out infinite alternate;
}

.blob-c {
    width: 360px;
    height: 360px;
    left: 38%;
    top: 46%;
    background: radial-gradient(circle, #0087bd, transparent 70%);
    opacity: 0.35;
    animation: drift-c 30s ease-in-out infinite alternate;
}

.grid-fade {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse at 30% 40%, #000 20%, transparent 75%);
}

.brand-inner {
    position: relative;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    animation: fade-up 0.9s var(--ease) both;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.01em;
    text-decoration: none;
    width: fit-content;
}

.brand-mark:hover {
    text-decoration: none;
}

.logo {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    object-fit: cover;
    box-shadow: 0 8px 24px -6px rgba(0, 155, 215, 0.5);
    transition: transform 0.4s var(--ease-spring);
}

.brand-mark:hover .logo {
    transform: rotate(-6deg) scale(1.06);
}

.eyebrow {
    margin: 0 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
}

.eyebrow::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #009BD7;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
    animation: pulse-dot 2.4s ease-in-out infinite;
}

.brand-headline {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(32px, 3.4vw, 46px);
    line-height: 1.12;
    letter-spacing: -0.025em;
    background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, 0.72));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-copy {
    margin: 0 0 36px;
    max-width: 440px;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.72);
}

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

.feature-list li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    transition: transform 0.35s var(--ease), background 0.3s, border-color 0.3s;
    animation: fade-up 0.8s var(--ease) both;
}

.feature-list li:nth-child(1) { animation-delay: 0.25s; }
.feature-list li:nth-child(2) { animation-delay: 0.35s; }
.feature-list li:nth-child(3) { animation-delay: 0.45s; }

.feature-list li:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
}

.feature-ic {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #c7d2fe;
    background: linear-gradient(135deg, rgba(0, 155, 215, 0.35), rgba(0, 155, 215, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-list strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.feature-list small {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.62);
}

.brand-foot {
    margin: 0;
    font-size: 12.5px;
    color: rgba(226, 232, 240, 0.45);
}

.auth-panel {
    position: relative;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 28px 40px;
    background:
        radial-gradient(900px 500px at 100% 0%, var(--bg-glow-a), transparent 60%),
        radial-gradient(700px 480px at 0% 100%, var(--bg-glow-b), transparent 60%),
        var(--bg);
    transition: background-color 0.4s var(--ease);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-soft);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: transform 0.35s var(--ease-spring), background 0.3s, color 0.3s, border-color 0.3s;
}

.theme-toggle:hover {
    transform: rotate(18deg) scale(1.06);
    color: var(--primary);
    border-color: var(--border-strong);
}

.theme-toggle .ic {
    grid-area: 1 / 1;
    transition: transform 0.5s var(--ease), opacity 0.3s;
}

html[data-theme="light"] .ic-moon,
html[data-theme="dark"] .ic-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.4);
}

.auth-card {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 440px;
    padding: 36px 36px 32px;
    border-radius: var(--radius-card);
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
    backdrop-filter: blur(18px) saturate(1.3);
    animation: card-in 0.8s var(--ease) both;
    transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}

.auth-state {
    animation: state-in 0.5s var(--ease) both;
}

.card-busy {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    border-radius: inherit;
    background: var(--busy-bg);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: fade-in 0.25s ease both;
}

.card-busy p {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-soft);
}

.spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--ring);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.panel-foot {
    margin: 24px 0 0;
    font-size: 13px;
    color: var(--muted);
    animation: fade-in 1s ease 0.4s both;
}

.tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 3px;
    margin-bottom: 26px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: color-mix(in srgb, var(--text) 4%, transparent);
}
.tab-indicator {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: calc((100% - 6px) / 3);
    border-radius: 10px;
    background: var(--bg);
    box-shadow: var(--tab-shadow);
    transition: transform 0.4s var(--ease);
}
.tabs[data-active="register"] .tab-indicator {
    transform: translateX(100%);
}
.tabs[data-active="recover"] .tab-indicator {
    transform: translateX(200%);
}
.tab {
    position: relative;
    z-index: 1;
    height: 38px;
    padding: 0 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    font-weight: 500;
    font-size: 13.5px;
    color: var(--muted);
    transition: color 0.25s;
}
.tab[aria-selected="true"] {
    color: var(--text);
    font-weight: 600;
}
.tab:hover:not([aria-selected="true"]) {
    color: var(--text);
}
.tab-copy {
    margin-bottom: 24px;
}

.tab-copy h2,
.auth-state > h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
}

.tab-copy p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--muted);
}

.tab-copy p strong {
    color: var(--text);
    font-weight: 600;
    word-break: break-all;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: state-in 0.45s var(--ease) both;
}

.field {
    display: block;
}

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

.field-label-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    margin-bottom: 8px;
}

.field-label-row .field-label {
    margin-bottom: 0;
}

.control {
    position: relative;
}

.control-ic {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 19px;
    height: 19px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    transition: color 0.25s, transform 0.3s var(--ease);
}

.control:focus-within .control-ic {
    color: var(--primary);
}

.input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border-radius: var(--radius-field);
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-weight: 500;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.25s, background-color 0.25s;
    -webkit-appearance: none;
    appearance: none;
}

.input::placeholder {
    color: var(--muted);
    opacity: 0.75;
    font-weight: 400;
}

.input:hover {
    border-color: var(--border-strong);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    animation: field-breathe 2.2s ease-in-out infinite;
}

.input[aria-invalid="true"]:focus {
    animation: none;
}

.input.has-toggle {
    padding-right: 48px;
}

.input.has-status {
    padding-right: 44px;
}

.input[aria-invalid="true"] {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-ring);
}

.input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 40px var(--input-bg) inset;
    transition: background-color 9999s;
}

.input.shake,
.otp-boxes.shake {
    animation: shake 0.45s var(--ease);
}

.toggle-visibility {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    transition: color 0.2s, background 0.2s;
}

.toggle-visibility:hover {
    color: var(--text);
    background: var(--tab-bg);
}

.toggle-visibility[aria-pressed="true"] .ic-show,
.toggle-visibility[aria-pressed="false"] .ic-hide {
    display: none;
}

.status-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 20px;
    height: 20px;
    transform: translateY(-50%) scale(0.6);
    opacity: 0;
    border-radius: 50%;
    transition: opacity 0.25s, transform 0.35s var(--ease-spring);
}

.status-icon[data-state] {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.status-icon[data-state="checking"] {
    border: 2.5px solid var(--ring);
    border-top-color: var(--primary);
    animation: spin-center 0.7s linear infinite;
}

.status-icon[data-state="ok"] {
    background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.status-icon[data-state="bad"] {
    background: var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.field-hint {
    margin: 8px 2px 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
    transition: color 0.25s;
}

.field-hint[data-tone="ok"] {
    color: var(--success-text);
}

.field-hint[data-tone="bad"] {
    color: var(--danger-text);
}

.inline-link {
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    transition: opacity 0.2s;
}

.inline-link:hover:not(:disabled) {
    text-decoration: underline;
}

.inline-link:disabled {
    color: var(--muted);
    cursor: not-allowed;
    text-decoration: none;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 13.5px;
    line-height: 1.55;
    animation: alert-in 0.4s var(--ease) both;
}

.alert .ic {
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.alert[data-tone="info"] {
    border-color: var(--info-border);
    background: var(--info-bg);
    color: var(--info-text);
}

.alert[data-tone="success"] {
    border-color: var(--success-border);
    background: var(--success-bg);
    color: var(--success-text);
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 48px;
    padding: 0 22px;
    overflow: hidden;
    border: 1.5px solid transparent;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.25s var(--ease), box-shadow 0.3s var(--ease), background 0.25s, border-color 0.25s, opacity 0.25s, color 0.25s;
}

.btn:active:not(:disabled) {
    transform: scale(0.985);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.btn-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

.btn[data-loading="true"] .btn-spinner {
    display: inline-block;
}

.btn[data-loading="true"] {
    pointer-events: none;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    box-shadow: 0 10px 24px -8px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

html[data-theme="dark"] .btn-primary {
    color: #0b1020;
}

html[data-theme="dark"] .btn-primary .btn-spinner {
    border-color: rgba(11, 16, 32, 0.3);
    border-top-color: #0b1020;
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s var(--ease);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px -10px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-primary:hover:not(:disabled)::after {
    transform: translateX(120%);
}

.btn-secondary {
    color: var(--text);
    background: transparent;
    border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--tab-bg);
}

.btn-ghost {
    height: 42px;
    color: var(--muted);
    background: transparent;
    font-size: 14px;
}

.btn-ghost:hover:not(:disabled) {
    color: var(--text);
    background: var(--tab-bg);
}

.btn-facebook {
    height: 40px;
    gap: 10px;
    color: #fff;
    background: #1877f2;
    font-size: 14px;
    box-shadow: 0 6px 16px -8px rgba(24, 119, 242, 0.7);
}

.btn-facebook:hover:not(:disabled) {
    background: #166fe5;
    transform: translateY(-1px);
    box-shadow: 0 12px 22px -10px rgba(24, 119, 242, 0.75);
}

.ic-fb {
    width: 18px;
    height: 18px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0 -2px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
}

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

.social-stack {
    display: grid;
    gap: 10px;
}

.gsi-slot {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color-scheme: light;
}

.gsi-slot:not([data-ready])::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sk-a) 25%, var(--sk-b) 50%, var(--sk-a) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.gsi-slot[data-failed]::before {
    animation: none;
    background: none;
}

.legal {
    margin: 2px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -6px 0 18px -8px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.2s, background 0.2s, transform 0.3s var(--ease);
}

.back-link:hover {
    color: var(--text);
    background: var(--tab-bg);
}

.back-link:hover .ic {
    transform: translateX(-3px);
}

.back-link .ic {
    width: 17px;
    height: 17px;
    transition: transform 0.3s var(--ease);
}

.stepper {
    list-style: none;
    display: flex;
    margin: 0 0 26px;
    padding: 0;
}

.step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    transition: color 0.3s;
}

.step::before {
    content: "";
    position: absolute;
    top: 13px;
    right: 50%;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.5s var(--ease);
}

.step:first-child::before {
    display: none;
}

.dot {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: var(--card);
    color: transparent;
    transition: background 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s, transform 0.4s var(--ease-spring);
}

.dot .ic {
    width: 14px;
    height: 14px;
    stroke-width: 3.2;
}

.stepper[data-step="2"] .step:nth-child(1) .dot,
.stepper[data-step="3"] .step:nth-child(-n+2) .dot {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

html[data-theme="dark"] .stepper[data-step="2"] .step:nth-child(1) .dot,
html[data-theme="dark"] .stepper[data-step="3"] .step:nth-child(-n+2) .dot {
    color: #0b1020;
}

.stepper[data-step="2"] .step:nth-child(2) .dot,
.stepper[data-step="3"] .step:nth-child(3) .dot {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px var(--ring);
    transform: scale(1.06);
}

.stepper[data-step="2"] .step:nth-child(-n+2),
.stepper[data-step="3"] .step:nth-child(-n+3) {
    color: var(--text);
}

.stepper[data-step="2"] .step:nth-child(-n+2)::before,
.stepper[data-step="3"] .step:nth-child(-n+3)::before {
    background: var(--primary);
}

.otp-boxes {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.otp-box {
    width: 100%;
    min-width: 0;
    height: 58px;
    padding: 0;
    text-align: center;
    border-radius: 14px;
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    caret-color: var(--primary);
    transition: border-color 0.2s, box-shadow 0.25s, transform 0.25s var(--ease-spring), background 0.25s;
    -webkit-appearance: none;
    appearance: none;
}

.otp-box:focus {
    outline: none;
    border-color: var(--primary);
    transform: translateY(-2px);
    animation: field-breathe 2.2s ease-in-out infinite;
}

.otp-box.filled {
    border-color: var(--primary);
    animation: pop 0.3s var(--ease-spring);
}

.otp-boxes.error .otp-box {
    border-color: var(--danger);
    background: var(--danger-bg);
}

.otp-boxes.success .otp-box {
    border-color: var(--success);
    background: var(--success-bg);
}

.dev-note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed var(--info-border);
    background: var(--info-bg);
    color: var(--info-text);
    font-size: 13px;
    line-height: 1.55;
    animation: alert-in 0.4s var(--ease) both;
}

.dev-note .ic {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.dev-note strong,
.dev-note span {
    display: block;
}

.dev-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px 12px;
    border: 1px solid var(--info-border);
    border-radius: 10px;
    background: var(--card);
    color: var(--text);
    font-size: 17px;
    letter-spacing: 0.25em;
    transition: transform 0.2s var(--ease), border-color 0.2s;
}

.dev-code:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.dev-code .ic {
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.resend-row {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

.strength {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 12px;
}

.strength i {
    height: 4px;
    border-radius: 4px;
    background: var(--border);
    transition: background 0.35s var(--ease), transform 0.35s var(--ease);
    transform-origin: left;
}

.strength[data-level="1"] i:nth-child(1) { background: var(--danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--warning); }
.strength[data-level="3"] i:nth-child(-n+3) { background: #3b82f6; }
.strength[data-level="4"] i { background: var(--success); }

.provider-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    padding: 7px 12px 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--success-border);
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 12.5px;
    font-weight: 600;
}

.provider-chip .ic {
    width: 16px;
    height: 16px;
}

.state-success {
    padding: 14px 0 6px;
    text-align: center;
}

.state-success h2 {
    margin: 22px 0 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -0.02em;
}

.state-success p {
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
}

.success-mark {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto;
}

.success-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--success-bg);
    animation: ripple 1.6s var(--ease) 0.2s infinite;
}

.success-mark svg {
    position: relative;
    width: 100%;
    height: 100%;
}

.sm-ring,
.sm-tick {
    fill: none;
    stroke: var(--success);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sm-ring {
    stroke-width: 3;
    stroke-dasharray: 146;
    stroke-dashoffset: 146;
    transform-origin: center;
    transform: rotate(-90deg);
    animation: draw 0.8s var(--ease) 0.05s forwards;
}

.sm-tick {
    stroke-width: 4;
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: draw 0.5s var(--ease) 0.6s forwards;
}

.redirect-bar {
    width: 160px;
    height: 4px;
    margin: 26px auto 0;
    overflow: hidden;
    border-radius: 4px;
    background: var(--border);
}

.redirect-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    animation: fill-bar var(--redirect-ms, 1400ms) linear forwards;
}

.skeleton-stack {
    display: grid;
    gap: 16px;
    padding: 4px 0;
}

.sk {
    display: block;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--sk-a) 25%, var(--sk-b) 50%, var(--sk-a) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.sk-title { width: 62%; height: 28px; }
.sk-line { width: 88%; height: 14px; margin-bottom: 8px; }
.sk-field { height: 48px; }
.sk-btn { height: 48px; border-radius: 999px; margin-top: 6px; }

.toasts {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: min(380px, calc(100vw - 32px));
    padding: 14px 14px 17px 14px;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--toast-border);
    background: var(--toast-bg);
    color: var(--toast-text);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.55s var(--ease) both;
}

.toast.leaving {
    animation: toast-out 0.35s var(--ease) forwards;
}

.toast-ic {
    width: 34px;
    height: 34px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 11px;
}

.toast-ic .ic {
    width: 19px;
    height: 19px;
    stroke-width: 2.2;
}

.toast[data-type="success"] .toast-ic { background: var(--success-bg); color: var(--success); }
.toast[data-type="error"] .toast-ic { background: var(--danger-bg); color: var(--danger); }
.toast[data-type="info"] .toast-ic { background: var(--info-bg); color: var(--primary); }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-title {
    margin: 1px 0 2px;
    font-size: 14px;
    font-weight: 700;
}

.toast-msg {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
    word-wrap: break-word;
}

.toast-close {
    width: 28px;
    height: 28px;
    flex: none;
    display: grid;
    place-items: center;
    margin: -2px -2px 0 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
    background: var(--tab-bg);
    color: var(--text);
}

.toast-close .ic {
    width: 16px;
    height: 16px;
}

.toast-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    transform-origin: left;
    animation: fill-bar var(--toast-ms, 4500ms) linear reverse forwards;
}

.toast[data-type="success"] .toast-bar { background: var(--success); }
.toast[data-type="error"] .toast-bar { background: var(--danger); }
.toast[data-type="info"] .toast-bar { background: var(--primary); }

.toast:hover .toast-bar {
    animation-play-state: paused;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
    background: var(--overlay);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-card {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 30px 28px 26px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--toast-bg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    transform: translateY(16px) scale(0.96);
    transition: transform 0.4s var(--ease-spring);
}

.modal-overlay.show .modal-card {
    transform: none;
}

.modal-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--info-bg);
    color: var(--primary);
}

.modal-icon .ic {
    width: 26px;
    height: 26px;
}

.modal-card h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.01em;
}

.modal-card p {
    margin: 0 0 24px;
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--muted);
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.modal-actions .btn {
    padding: 0 14px;
    font-size: 14px;
    white-space: nowrap;
}

.avatar-field {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1.5px dashed var(--input-border);
    background: var(--input-bg);
    transition: border-color 0.25s, background-color 0.25s, box-shadow 0.25s;
}

.avatar-field.drag {
    border-color: var(--primary);
    background: var(--info-bg);
    box-shadow: 0 0 0 4px var(--ring);
}

.avatar-field.shake {
    animation: shake 0.45s var(--ease);
}

.avatar-drop {
    position: relative;
    width: 76px;
    height: 76px;
    flex: none;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--tab-bg);
    color: var(--muted);
    transition: transform 0.35s var(--ease-spring), box-shadow 0.3s;
}

.avatar-drop:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px var(--ring);
}

.avatar-drop img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    animation: pop 0.4s var(--ease-spring);
}

.avatar-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
}

.avatar-empty .avatar-fallback {
    width: 30px;
    height: 30px;
    stroke-width: 1.5;
}

.avatar-default {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.avatar-drop.has-image .avatar-empty {
    display: none;
}

.avatar-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 3px solid var(--card);
    background: var(--primary);
    color: #fff;
}

html[data-theme="dark"] .avatar-badge {
    color: #0b1020;
}

.avatar-badge .ic {
    width: 13px;
    height: 13px;
    stroke-width: 2.4;
}

.avatar-drop[data-loading="true"]::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid var(--ring);
    border-top-color: var(--primary);
    background: var(--busy-bg);
    animation: spin 0.8s linear infinite;
}

.avatar-meta {
    min-width: 0;
}

.avatar-meta strong {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.avatar-meta em {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--tab-bg);
    color: var(--muted);
    font-style: normal;
    font-size: 11.5px;
    font-weight: 600;
}

.avatar-meta small {
    display: block;
    margin-top: 4px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
}

.avatar-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.inline-link.danger {
    color: var(--danger);
}

.human-check {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    transition: border-color 0.3s, background-color 0.3s;
}

html[data-human="off"] .human-check {
    display: none;
}

.form-stack[data-gated="false"] .human-check {
    border-color: var(--success-border);
}

.human-check[data-pass="on"] .turnstile-slot {
    display: none;
}

.turnstile-slot {
    position: relative;
    width: 100%;
    min-width: 0;
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    contain: inline-size;
    border-radius: 12px;
    color-scheme: normal;
}

.turnstile-slot[data-fit="scaled"] {
    display: block;
}

.turnstile-slot[data-fit="scaled"] > :first-child {
    transform-origin: 0 0;
}

.turnstile-slot:empty::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--sk-a) 25%, var(--sk-b) 50%, var(--sk-a) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.human-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted);
    transition: color 0.25s;
}

.human-text {
    flex: 1;
    min-width: 0;
}

.human-dot {
    width: 8px;
    height: 8px;
    flex: none;
    border-radius: 50%;
    background: var(--border-strong);
    transition: background-color 0.3s, box-shadow 0.3s;
}

.human-hint[data-state="loading"] .human-dot,
.human-hint[data-state="pending"] .human-dot,
.human-hint[data-state="expired"] .human-dot {
    background: var(--warning);
    animation: pulse-warn 1.8s ease-in-out infinite;
}

.human-hint[data-state="verified"] {
    color: var(--success-text);
}

.human-hint[data-state="verified"] .human-dot {
    background: var(--success);
    box-shadow: 0 0 0 4px var(--success-bg);
}

.human-hint[data-state="error"] {
    color: var(--danger-text);
}

.human-hint[data-state="error"] .human-dot {
    background: var(--danger);
}

.btn[aria-disabled="true"] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    filter: saturate(0.6);
}

.btn[aria-disabled="true"]:hover:not(:disabled),
.btn[aria-disabled="true"]:active:not(:disabled) {
    transform: none;
    box-shadow: none;
}

.btn-primary[aria-disabled="true"]::after {
    display: none;
}

.gsi-slot[data-locked]::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 4;
    border-radius: 999px;
    background: var(--card);
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes state-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: none; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes alert-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(40px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(40px) scale(0.96); }
}

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

@keyframes spin-center {
    to { transform: translateY(-50%) rotate(360deg); }
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

@keyframes pop {
    0% { transform: scale(0.88); }
    60% { transform: scale(1.07); }
    100% { transform: scale(1); }
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

@keyframes ripple {
    0% { transform: scale(0.8); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}

@keyframes fill-bar {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

@keyframes pulse-warn {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0); }
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0); }
}

@keyframes drift-a {
    to { transform: translate(120px, 90px) scale(1.15); }
}

@keyframes drift-b {
    to { transform: translate(-110px, -80px) scale(1.1); }
}

@keyframes drift-c {
    to { transform: translate(-90px, 60px) scale(0.85); }
}

@media (max-width: 1100px) {
    .brand-inner {
        padding: 40px 36px;
    }
}

@media (max-width: 960px) {
    .page {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
    }

    .brand-panel {
        min-width: 0;
    }

    .brand-inner {
        max-width: none;
        padding: calc(20px + env(safe-area-inset-top)) 24px 56px;
        gap: 0;
    }

    .brand-body,
    .brand-foot {
        display: none;
    }

    .blob {
        animation: none;
        filter: blur(56px);
        will-change: auto;
    }

    .auth-panel {
        justify-content: flex-start;
        margin-top: -28px;
        padding: 28px 16px calc(32px + env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
        z-index: 2;
    }

    .theme-toggle {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
    }

    .auth-card {
        margin-top: 28px;
        padding: 26px 22px 24px;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    html[data-theme="light"] .auth-card {
        background: #ffffff;
    }

    html[data-theme="dark"] .auth-card {
        background: #111827;
    }

    .card-busy {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .input {
        font-size: 16px;
    }

    .human-check {
        padding: 8px;
    }

    .toasts {
        left: 16px;
        right: 16px;
        align-items: center;
    }
}

@media (max-width: 960px) and (max-height: 520px) {
    .brand-inner {
        padding-bottom: 40px;
    }

    .auth-card {
        margin-top: 20px;
    }
}

@media (max-width: 380px) {
    .auth-panel {
        padding-left: 12px;
        padding-right: 12px;
    }

    .auth-card {
        padding: 22px 16px 20px;
        border-radius: 20px;
    }

    .tab-copy h2,
    .auth-state > h2,
    .state-success h2 {
        font-size: 22px;
    }

    .btn {
        padding: 0 14px;
        font-size: 14.5px;
    }

    .human-check {
        padding: 6px;
    }

    .otp-boxes {
        gap: 6px;
    }

    .otp-box {
        height: 50px;
        border-radius: 12px;
        font-size: 20px;
    }

    .avatar-field {
        flex-direction: column;
        text-align: center;
    }

    .avatar-actions {
        justify-content: center;
    }

    .modal-card {
        padding: 24px 20px 20px;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }
}

.control::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
    pointer-events: none;
    transition: transform 0.45s var(--ease), opacity 0.3s;
}

.control:focus-within::after {
    opacity: 1;
    transform: scaleX(1);
    animation: bar-flow 2.4s linear infinite;
}

.control:has(.input[aria-invalid="true"])::after {
    background: var(--danger);
    opacity: 1;
    transform: scaleX(1);
    animation: none;
}

.alert .alert-action {
    display: block;
    margin-top: 6px;
    color: inherit;
    text-decoration: underline;
}

.state-merged {
    padding: 8px 0 4px;
    text-align: center;
}

.state-merged h2 {
    margin: 20px 0 8px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.state-merged > p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.6;
}

.merge-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 88px;
}

.merge-node {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: var(--input-bg);
    box-shadow: 0 12px 26px -14px var(--primary-glow);
}

.merge-node .ic {
    width: 26px;
    height: 26px;
    color: var(--primary);
}

.merge-g {
    width: 28px;
    height: 28px;
}

.merge-node-a {
    animation: node-in-left 0.7s var(--ease) both;
}

.merge-node-b {
    animation: node-in-right 0.7s var(--ease) both;
}

.merge-bridge {
    position: relative;
    width: 84px;
    height: 4px;
    margin: 0 -3px;
    border-radius: 4px;
    background: var(--border);
}

.merge-bridge i {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    animation: fill-bar 0.6s var(--ease) 0.55s forwards;
}

.merge-core {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin: -16px 0 0 -16px;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    box-shadow: 0 0 0 5px var(--success-bg);
    transform: scale(0);
    animation: core-pop 0.55s var(--ease-spring) 1.1s forwards;
}

.merge-core::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--success);
    opacity: 0;
    animation: ripple 1.8s var(--ease) 1.6s infinite;
}

.merge-core .ic {
    position: relative;
    width: 18px;
    height: 18px;
    stroke-width: 2.6;
}

.state-merged .provider-chip {
    margin-bottom: 0;
}

.merge-methods {
    display: grid;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.merge-methods li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    opacity: 0;
    animation: fade-up 0.5s var(--ease) forwards;
}

.merge-methods li:nth-child(1) { animation-delay: 0.9s; }
.merge-methods li:nth-child(2) { animation-delay: 1.1s; }

.merge-methods li > span:nth-child(2) {
    flex: 1;
}

.merge-method-ic {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--tab-bg);
}

.merge-method-ic .ic {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.merge-g-sm {
    width: 18px;
    height: 18px;
}

.merge-tick {
    flex: none;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--success);
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.merge-tick path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}

.merge-methods li:nth-child(1) .merge-tick path { animation: draw 0.45s var(--ease) 1.25s forwards; }
.merge-methods li:nth-child(2) .merge-tick path { animation: draw 0.45s var(--ease) 1.45s forwards; }

.state-merged .redirect-bar {
    width: 100%;
    margin-top: 22px;
}

.merge-continue {
    margin-top: 16px;
}

@keyframes bar-flow {
    from { background-position: 0 0; }
    to { background-position: 200% 0; }
}

@keyframes field-breathe {
    0%, 100% { box-shadow: 0 0 0 0 var(--ring), 0 10px 22px -16px var(--primary-glow); }
    50% { box-shadow: 0 0 0 5px var(--ring), 0 14px 28px -14px var(--primary-glow); }
}

@keyframes focus-pulse {
    0%, 100% { box-shadow: 0 0 0 0 var(--primary-glow); }
    50% { box-shadow: 0 0 0 6px transparent; }
}

@keyframes node-in-left {
    from { opacity: 0; transform: translateX(-34px) scale(0.85); }
    to { opacity: 1; transform: none; }
}

@keyframes node-in-right {
    from { opacity: 0; transform: translateX(34px) scale(0.85); }
    to { opacity: 1; transform: none; }
}

@keyframes core-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

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

.stepper[data-step="1"] .step:nth-child(1) {
    color: var(--text);
}
.stepper[data-step="1"] .step:nth-child(1) .dot {
    border-color: var(--primary);
    box-shadow: 0 0 0 5px var(--ring);
    transform: scale(1.06);
}
.stepper[data-step="4"] .step {
    color: var(--text);
}
.stepper[data-step="4"] .step .dot {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.stepper[data-step="4"] .step::before {
    background: var(--primary);
}
html[data-theme="dark"] .stepper[data-step="4"] .step .dot {
    color: #0b1020;
}
.recover {
    display: block;
}
.rc-pane {
    animation: rc-in-fwd 0.5s var(--ease) both;
}
.recover[data-dir="back"] .rc-pane {
    animation-name: rc-in-back;
}
.rc-flow {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.rc-flow .btn,
.rc-pane.form-stack .btn {
    width: 100%;
}
.rc-flow .back-link {
    align-self: center;
    margin: 0;
}
.rc-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-soft);
}
.rc-lead strong {
    color: var(--text);
    font-weight: 600;
    word-break: break-all;
}
.rc-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--info-border);
    border-radius: var(--radius-field);
    background: var(--info-bg);
    color: var(--info-text);
    font-size: 12.5px;
    line-height: 1.55;
}
.rc-note .ic {
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.rc-done {
    align-items: center;
    text-align: center;
}
.rc-done h3 {
    margin: 4px 0 0;
    font-family: var(--font-display);
    font-size: 21px;
    letter-spacing: -0.01em;
    color: var(--text);
}
.rc-done p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-soft);
}
.rc-done .btn {
    margin-top: 6px;
}
@keyframes rc-in-fwd {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: none; }
}
@keyframes rc-in-back {
    from { opacity: 0; transform: translateX(-24px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .rc-pane { animation: none; }
    .tab-indicator { transition: none; }
}
