/* ===== Variables ===== */
:root {
    --bg-primary: #06060b;
    --bg-secondary: #0a0a12;
    --surface: #0d0d15;
    --surface-light: #14141f;
    --surface-border: rgba(255, 255, 255, 0.06);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-deep: #6d28d9;
    --accent-glow: rgba(124, 58, 237, 0.35);
    --text-primary: #e8e8f0;
    --text-secondary: #8b8ba0;
    --text-muted: #52526b;
    --error: #ff4757;
    --error-light: #ff6b7a;
    --success: #2ed573;
    --success-light: #5cdb8b;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    overflow-x: hidden;
    max-width: 100vw;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255, 255, 255, 0.03);
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body.modal-open { overflow: hidden; }

a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: pointer; font-family: inherit; color: inherit; }
input { font-family: inherit; }

/* ===== Loader Overlay ===== */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #06060b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.loader-overlay.fade-out {
    animation: loaderDismiss 0.9s cubic-bezier(0.4, 0, 0, 1) forwards;
}

#loader-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.loader-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0;
    animation: fadeIn 3s 0.3s ease forwards;
    pointer-events: none;
}

.loader-ambient {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.loader-logo {
    position: relative;
    z-index: 2;
    overflow: hidden;
    opacity: 0;
    animation: logoReveal 1s 1.4s var(--ease-out) forwards;
}

.loader-logo-text {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 10px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.93);
}

.loader-logo-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(168, 85, 247, 0.3) 35%,
        rgba(255, 255, 255, 0.45) 42%,
        rgba(124, 58, 237, 0.3) 50%,
        transparent 65%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmerSweep 3s 2s ease-in-out infinite;
    pointer-events: none;
}

.loader-blocks {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 3px;
    margin-top: 32px;
    opacity: 0;
    animation: fadeIn 0.3s 2.0s ease forwards;
}

.lb {
    width: 8px;
    height: 3px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 1px;
    animation: blockLight 1.8s ease forwards;
    animation-play-state: paused;
}

.lb:nth-child(1)  { animation-delay: 2.1s; animation-play-state: running; }
.lb:nth-child(2)  { animation-delay: 2.16s; animation-play-state: running; }
.lb:nth-child(3)  { animation-delay: 2.22s; animation-play-state: running; }
.lb:nth-child(4)  { animation-delay: 2.28s; animation-play-state: running; }
.lb:nth-child(5)  { animation-delay: 2.34s; animation-play-state: running; }
.lb:nth-child(6)  { animation-delay: 2.40s; animation-play-state: running; }
.lb:nth-child(7)  { animation-delay: 2.46s; animation-play-state: running; }
.lb:nth-child(8)  { animation-delay: 2.52s; animation-play-state: running; }
.lb:nth-child(9)  { animation-delay: 2.58s; animation-play-state: running; }
.lb:nth-child(10) { animation-delay: 2.64s; animation-play-state: running; }
.lb:nth-child(11) { animation-delay: 2.70s; animation-play-state: running; }
.lb:nth-child(12) { animation-delay: 2.76s; animation-play-state: running; }
.lb:nth-child(13) { animation-delay: 2.82s; animation-play-state: running; }
.lb:nth-child(14) { animation-delay: 2.88s; animation-play-state: running; }
.lb:nth-child(15) { animation-delay: 2.94s; animation-play-state: running; }
.lb:nth-child(16) { animation-delay: 3.00s; animation-play-state: running; }
.lb:nth-child(17) { animation-delay: 3.06s; animation-play-state: running; }
.lb:nth-child(18) { animation-delay: 3.12s; animation-play-state: running; }
.lb:nth-child(19) { animation-delay: 3.18s; animation-play-state: running; }
.lb:nth-child(20) { animation-delay: 3.24s; animation-play-state: running; }

.loader-status {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    opacity: 0;
    animation: fadeIn 0.4s 2.1s ease forwards;
}

.loader-status-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8b7cf7;
    animation: statusPulse 1.2s 2.1s ease-in-out infinite;
}

.loader-status-text {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* ===== Page Layout ===== */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.auth-ambient {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(124, 58, 237, 0.045) 0%, transparent 65%);
    pointer-events: none;
    z-index: 1;
}

/* ===== Card ===== */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-out),
                transform 0.8s var(--ease-out);
}

.auth-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.auth-panel {
    background: rgba(10, 10, 18, 0.75);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 36px 32px 28px;
    position: relative;
    overflow: hidden;
}

.auth-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: rgba(124, 58, 237, 0.2);
}

.auth-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 12px;
    position: relative;
}

.auth-logo-cube {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(-20deg) rotateY(30deg);
    animation: logoCubeFloat 6s ease-in-out infinite;
    perspective: 400px;
}

.auth-logo-cube div {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(124, 58, 237, 0.25);
    background: rgba(124, 58, 237, 0.03);
}

.auth-logo-cube div:nth-child(1) { transform: rotateY(0deg) translateZ(20px); }
.auth-logo-cube div:nth-child(2) { transform: rotateY(180deg) translateZ(20px); }
.auth-logo-cube div:nth-child(3) { transform: rotateY(90deg) translateZ(20px); }
.auth-logo-cube div:nth-child(4) { transform: rotateY(-90deg) translateZ(20px); }
.auth-logo-cube div:nth-child(5) { transform: rotateX(90deg) translateZ(20px); }
.auth-logo-cube div:nth-child(6) { transform: rotateX(-90deg) translateZ(20px); }

.auth-logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.auth-logo h1 span {
    color: #a78bfa;
    -webkit-text-fill-color: #a78bfa;
}

.auth-tabs {
    display: flex;
    position: relative;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab {
    flex: 1;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.auth-tab:hover {
    color: var(--text-secondary);
}

.auth-tab.active {
    color: var(--text-primary);
}

.tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50%;
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    transition: transform 0.4s var(--ease-out);
}

.tab-indicator::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 6px;
    background: var(--accent);
    filter: blur(6px);
    opacity: 0.4;
}

.tab-indicator.right {
    transform: translateX(100%);
}

.auth-message {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 0;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-message.visible {
    opacity: 1;
    max-height: 60px;
    margin-bottom: 12px;
}

.auth-message.error {
    background: rgba(255, 71, 87, 0.07);
    border: 1px solid rgba(255, 71, 87, 0.12);
    color: var(--error-light);
}

.auth-message.success {
    background: rgba(46, 213, 115, 0.07);
    border: 1px solid rgba(46, 213, 115, 0.12);
    color: var(--success-light);
}

.auth-message.info {
    background: rgba(124, 58, 237, 0.07);
    border: 1px solid rgba(124, 58, 237, 0.12);
    color: var(--accent-light);
}

.auth-forms {
    position: relative;
}

.auth-form {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.auth-form.hidden {
    display: none;
}

.auth-form.slide-out {
    opacity: 0;
    transform: translateX(-12px);
}

.auth-form.slide-in {
    opacity: 0;
    transform: translateX(12px);
}

.field-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
    margin-bottom: 0;
    transition: margin 0.3s ease;
}

.field-chips:not(:empty) {
    margin-bottom: 16px;
}

.field-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 8px;
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 18px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: chipIn 0.35s var(--ease-out);
    max-width: 100%;
}

.field-chip:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.22);
    color: rgba(255, 255, 255, 0.8);
}

.chip-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    opacity: 0.45;
}

.chip-icon svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-edit {
    opacity: 0.3;
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
    margin-left: 2px;
}

.chip-edit svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-chip:hover .chip-edit {
    opacity: 0.45;
}

.steps-viewport {
    position: relative;
    height: 100px;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
    pointer-events: none;
}

.form-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.form-step.to-left {
    opacity: 0;
    transform: translateX(-24px);
}

.step-prompt {
    font-size: 14px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 16px;
    letter-spacing: 0.2px;
}

.step-field {
    position: relative;
}

.step-field input {
    width: 100%;
    padding: 8px 36px 10px 0;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    caret-color: var(--accent-light);
    letter-spacing: 0.2px;
}

.step-field input::placeholder {
    color: rgba(255, 255, 255, 0.18);
    font-weight: 400;
}

.field-line {
    position: relative;
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 1px;
}

.field-line::before {
    content: '';
    position: absolute;
    top: -0.5px;
    left: 50%;
    width: 0;
    height: 2px;
    transform: translateX(-50%);
    background: var(--accent);
    border-radius: 1px;
    transition: width 0.4s var(--ease-out);
}

.step-field:focus-within .field-line::before {
    width: 100%;
}

.field-line::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 8px;
    transform: translateX(-50%);
    background: rgba(124, 58, 237, 0.25);
    filter: blur(5px);
    transition: width 0.45s var(--ease-out);
}

.step-field:focus-within .field-line::after {
    width: 50%;
}

.step-field.has-error .field-line::before {
    width: 100%;
    background: var(--error);
}

.step-field.has-error .field-line::after {
    width: 40%;
    background: rgba(255, 71, 87, 0.2);
}

/* ===== Error ===== */
.step-error {
    display: block;
    font-size: 12px;
    color: var(--error);
    margin-top: 10px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.step-error.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Verify Code Step ===== */
.verify-step.active ~ .steps-viewport-spacer,
.form-step.verify-step.active {
    /* handled by JS height toggle */
}

.verify-step {
    text-align: center;
}

.verify-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.15);
}

.verify-icon svg {
    width: 24px;
    height: 24px;
}

.verify-step .step-prompt {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 4px;
    letter-spacing: 0;
}

.verify-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 18px;
    line-height: 1.3;
}

.verify-email-target {
    color: var(--accent-light, #a78bfa);
    font-weight: 500;
}

.verify-code-field input {
    text-align: center;
    font-size: 28px !important;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 12px !important;
    padding: 10px 0 12px !important;
    color: #fff;
}

.verify-code-field input::placeholder {
    letter-spacing: 8px;
    font-size: 22px;
    color: rgba(255, 255, 255, 0.1);
}

.verify-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.verify-timer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.22);
}

.verify-resend {
    background: none;
    border: none;
    color: var(--accent, #7c3aed);
    font-size: 11px;
    cursor: pointer;
    padding: 0;
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.2s;
}

.verify-resend:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

.verify-resend:not(:disabled):hover {
    text-decoration: underline;
}

/* ===== Password Toggle ===== */
.step-field .password-toggle {
    position: absolute;
    right: 0;
    top: 6px;
    color: var(--text-muted);
    opacity: 0.3;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.step-field:focus-within .password-toggle {
    opacity: 0.55;
    color: var(--accent-light);
}

.step-field .password-toggle:hover {
    opacity: 1;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ===== Actions ===== */
.step-actions {
    display: flex;
    align-items: center;
    margin-top: 12px;
}

.back-btn {
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    width: 0;
    min-width: 0;
    opacity: 0;
    overflow: hidden;
    border: 0 solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: var(--text-muted);
    margin-right: 0;
    transition: width 0.3s var(--ease-out),
                opacity 0.3s ease,
                margin 0.3s ease,
                border-width 0.3s ease,
                background 0.15s ease,
                color 0.15s ease;
}

.back-btn.visible {
    width: 44px;
    min-width: 44px;
    opacity: 1;
    border-width: 1px;
    background: rgba(255, 255, 255, 0.03);
    margin-right: 10px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.back-btn:active {
    transform: scale(0.95);
}

/* ===== Slide Track ===== */
.slide-track {
    flex: 1;
    height: 50px;
    background: rgba(124, 58, 237, 0.06);
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: 25px;
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    outline: none;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.slide-track:focus-visible {
    border-color: rgba(124, 58, 237, 0.3);
}

.slide-track::after {
    content: '\203A  \203A  \203A  \203A  \203A  \203A  \203A  \203A';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 54px;
    font-size: 14px;
    letter-spacing: 4px;
    color: rgba(124, 58, 237, 0.08);
    white-space: nowrap;
    animation: chevronDrift 3s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.slide-track.dragging::after,
.slide-track.loading::after,
.slide-track.locked::after {
    animation-play-state: paused;
    opacity: 0;
}

.slide-trail {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    width: 42px;
    background: rgba(124, 58, 237, 0.08);
    border-radius: 21px;
    z-index: 0;
    pointer-events: none;
}

.slide-handle {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 2;
    touch-action: none;
    will-change: left;
    animation: handlePulse 2.5s ease-in-out infinite;
}

.slide-handle:active {
    cursor: grabbing;
}

.slide-track.dragging .slide-handle {
    animation: none;
}

.slide-arrow { pointer-events: none; }
.slide-check { display: none; pointer-events: none; }
.slide-handle.completed .slide-arrow { display: none; }
.slide-handle.completed .slide-check { display: block; }

.slide-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    z-index: 1;
    pointer-events: none;
    padding-left: 42px;
}

.slide-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.slide-track.locked {
    opacity: 0.3;
    pointer-events: none;
}

.slide-track.locked .slide-handle {
    animation: none;
    cursor: default;
}

.slide-track.loading .slide-handle {
    animation: none;
    background: #8b5cf6;
}

.slide-track.loading .slide-arrow,
.slide-track.loading .slide-check { display: none; }
.slide-track.loading .slide-spinner { display: block; }
.slide-track.loading .slide-text { opacity: 0; }
.slide-track.loading .slide-trail { background: rgba(124, 58, 237, 0.12); }

.auth-footer p {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.1px;
}

.auth-footer a {
    color: var(--accent-light);
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-footer a:hover {
    color: #c4b5fd;
}

.captcha-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(6, 6, 11, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.captcha-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.captcha-card {
    width: 100%;
    max-width: 380px;
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 32px 28px 24px;
    position: relative;
    overflow: hidden;
    transform: translateY(12px) scale(0.97);
    transition: transform 0.4s var(--ease-out);
}

.captcha-overlay.is-open .captcha-card {
    transform: translateY(0) scale(1);
}

.captcha-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: rgba(124, 58, 237, 0.2);
}

.captcha-header {
    text-align: center;
    margin-bottom: 20px;
}

.captcha-header .captcha-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    color: var(--accent-light);
    opacity: 0.8;
}

.captcha-header .captcha-icon svg {
    width: 100%;
    height: 100%;
}

.captcha-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.captcha-header p {
    font-size: 12px;
    color: var(--text-muted);
}

.captcha-image-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.captcha-image-wrap img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
}

.captcha-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.captcha-input-row input {
    flex: 1;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s ease;
}

.captcha-input-row input:focus {
    border-color: rgba(124, 58, 237, 0.35);
}

.captcha-input-row input::placeholder {
    color: var(--text-muted);
    letter-spacing: 0;
    text-transform: none;
    font-weight: 400;
}

.captcha-refresh-btn {
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.captcha-refresh-btn:hover {
    background: rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.2);
    color: var(--accent-light);
}

.captcha-refresh-btn svg {
    width: 18px;
    height: 18px;
}

.captcha-actions {
    display: flex;
    gap: 8px;
}

.captcha-btn {
    flex: 1;
    padding: 11px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.captcha-btn--cancel {
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.captcha-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.captcha-btn--confirm {
    background: var(--accent);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.25);
}

.captcha-btn--confirm:hover {
    background: #8b5cf6;
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.captcha-btn--confirm:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.captcha-feedback {
    text-align: center;
    font-size: 12px;
    margin-top: 12px;
    min-height: 16px;
    transition: opacity 0.2s ease;
}

.captcha-feedback:empty {
    opacity: 0;
}

.captcha-feedback[data-tone="error"] { color: var(--error-light); }
.captcha-feedback[data-tone="success"] { color: var(--success-light); }
.captcha-feedback[data-tone="info"] { color: var(--text-muted); }

@keyframes logoCubeFloat {
    0%, 100% { transform: rotateX(-20deg) rotateY(30deg); }
    50% { transform: rotateX(-15deg) rotateY(40deg); }
}

@keyframes chipIn {
    from { opacity: 0; transform: translateY(-5px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes chevronDrift {
    from { transform: translateX(-16px); }
    to { transform: translateX(16px); }
}

@keyframes handlePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.2); }
    50% { box-shadow: 0 0 0 5px rgba(124, 58, 237, 0); }
}

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

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-4px); }
    30% { transform: translateX(4px); }
    45% { transform: translateX(-3px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-1px); }
}

@keyframes logoReveal {
    0% { opacity: 0; transform: translateY(8px); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes shimmerSweep {
    0% { background-position: 150% center; }
    35%, 100% { background-position: -50% center; }
}

@keyframes blockLight {
    0% { background: rgba(255, 255, 255, 0.04); box-shadow: none; }
    40% { background: rgba(168, 85, 247, 0.9); box-shadow: 0 0 8px rgba(168, 85, 247, 0.5); }
    100% { background: rgba(108, 92, 231, 0.55); box-shadow: 0 0 3px rgba(108, 92, 231, 0.2); }
}

@keyframes statusPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.4); }
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes loaderDismiss {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@media (max-width: 480px) {
    .auth-panel {
        padding: 28px 22px 24px;
        border-radius: 16px;
    }

    .auth-logo h1 { font-size: 18px; }
    .step-field input { font-size: 16px; }

    .captcha-card {
        padding: 24px 18px 20px;
        border-radius: 16px;
    }

    .auth-ambient,
    #three-canvas { display: none; }
}

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

.tg-fab { display: none !important; }
