/* ============================================
   HIVE — Onboarding
   Premium Discord-like profile setup
   Single viewport, no scroll on desktop
   ============================================ */

:root {
    --bg: #050816;
    --surface: #0b0f2a;
    --surface-2: #111640;
    --primary: #6C63FF;
    --primary-glow: rgba(108,99,255,0.15);
    --secondary: #00E5FF;
    --accent: #FF4D9E;
    --green: #7CFFB2;
    --red: #FF4757;
    --text: #f0f0f5;
    --text-2: #A7B0C0;
    --text-3: #5a6378;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --border-focus: rgba(108,99,255,0.5);
    --r: 10px;
    --r-lg: 16px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --ease: cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    height: 100dvh;
    overflow: hidden;
    display: flex;
}

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

/* ============================================
   BACKGROUND — subtle ambient
   ============================================ */
.bg-layer {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
}

.bg-orb-1 {
    width: 500px; height: 500px;
    background: var(--primary);
    top: -15%; left: -10%;
    animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-2 {
    width: 400px; height: 400px;
    background: var(--accent);
    bottom: -10%; right: -5%;
    animation: orbFloat 25s ease-in-out infinite reverse;
}

.bg-orb-3 {
    width: 300px; height: 300px;
    background: var(--secondary);
    top: 50%; left: 30%;
    opacity: 0.12;
    animation: orbFloat 18s ease-in-out infinite;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-30px, 20px) scale(0.95); }
}

.bg-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

#particles {
    position: fixed; inset: 0;
    z-index: 0; pointer-events: none;
}

/* ============================================
   SPLIT LAYOUT
   ============================================ */
.layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100dvh;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ============================================
   LEFT — Brand Panel
   ============================================ */
.left {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}

.left-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 2;
}

.left-brand svg {
    filter: drop-shadow(0 0 20px rgba(108,99,255,0.5));
}

.left-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    text-align: center;
    max-width: 420px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}

.gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.left-desc {
    font-size: 1rem;
    color: var(--text-2);
    line-height: 1.6;
    text-align: center;
    max-width: 340px;
    margin-bottom: 48px;
    position: relative;
    z-index: 2;
}

/* Illustration area */
.illustration {
    position: relative;
    width: 260px;
    height: 220px;
    z-index: 2;
}

.illustration svg {
    width: 100%;
    height: 100%;
}

/* Floating accent shapes */
.float-shape {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.fs-1 {
    width: 60px; height: 60px;
    border: 2px solid rgba(108,99,255,0.15);
    top: 15%; right: 15%;
    animation: floatSlow 8s ease-in-out infinite;
}

.fs-2 {
    width: 36px; height: 36px;
    background: rgba(0,229,255,0.08);
    bottom: 20%; left: 18%;
    animation: floatSlow 10s ease-in-out infinite reverse;
}

.fs-3 {
    width: 20px; height: 20px;
    border: 1.5px solid rgba(255,77,158,0.12);
    top: 60%; right: 10%;
    animation: floatSlow 7s ease-in-out infinite;
    animation-delay: -3s;
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-14px); }
}

/* ============================================
   RIGHT — Form Panel
   ============================================ */
.right {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px;
    background: rgba(11,15,42,0.4);
    border-left: 1px solid var(--border);
}

/* ============================================
   CARD — glassmorphism
   ============================================ */
.card {
    width: 100%;
    max-width: 380px;
    padding: 28px;
    border-radius: var(--r-lg);
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: relative;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.03),
        0 20px 60px -10px rgba(0,0,0,0.5),
        0 0 80px -20px var(--primary-glow);
    transition: border-color 0.4s;
}

.card:hover {
    border-color: rgba(255,255,255,0.1);
}

/* Mouse-follow glow */
.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        400px circle at var(--mx, 50%) var(--my, 50%),
        rgba(108,99,255,0.06),
        transparent 40%
    );
    z-index: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s;
}

.card:hover::before { opacity: 1; }

/* Top accent line */
.card::after {
    content: '';
    position: absolute;
    top: -1px; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), transparent);
    opacity: 0.4;
    border-radius: 1px;
    z-index: 1;
}

.card > * { position: relative; z-index: 1; }

/* ============================================
   STEP INDICATOR
   ============================================ */
.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 22px;
}

.step {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-3);
}

.step.done { color: var(--green); }
.step.active { color: var(--text); }

.step-num {
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
}

.step.done .step-num {
    background: var(--green);
    color: var(--bg);
    box-shadow: 0 0 10px rgba(124,255,178,0.3);
}

.step.active .step-num {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(108,99,255,0.3);
}

.step-line {
    width: 24px; height: 1px;
    background: var(--border);
}

/* ============================================
   AVATAR UPLOAD
   ============================================ */
.avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.avatar {
    position: relative;
    width: 96px; height: 96px;
    cursor: pointer;
    outline: none;
    transition: transform 0.3s var(--ease);
}

.avatar:hover { transform: scale(1.04); }

.avatar:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 50%;
}

/* Glow behind */
.avatar-glow {
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(108,99,255,0.15) 0%, transparent 70%);
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0.5;
}

.avatar:hover .avatar-glow { opacity: 1; }

/* Spinning border */
.avatar-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, var(--primary), var(--secondary), var(--accent), var(--primary));
    -webkit-mask: repeating-conic-gradient(#000 0 10deg, transparent 10deg 14deg);
    mask: repeating-conic-gradient(#000 0 10deg, transparent 10deg 14deg);
    animation: ringSpin 4s linear infinite;
}

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

.avatar:hover .avatar-ring { animation-duration: 2s; }

/* Inner circle */
.avatar-inner {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

/* Placeholder */
.avatar-ph {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-3);
    transition: color 0.3s;
}

.avatar-ph svg { opacity: 0.4; transition: all 0.3s; }
.avatar-ph span { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.02em; }

.avatar:hover .avatar-ph { color: var(--primary); }
.avatar:hover .avatar-ph svg { opacity: 0.8; transform: scale(1.08); }

/* Preview */
.avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: none;
    animation: imgReveal 0.4s var(--ease) forwards;
}

@keyframes imgReveal {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

.avatar.has-img .avatar-img { display: block; }
.avatar.has-img .avatar-ph { display: none; }

/* Success check */
.avatar-ok {
    position: absolute; inset: 0;
    border-radius: 50%;
    background: rgba(124,255,178,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; transform: scale(0.5);
    transition: all 0.4s var(--ease);
    z-index: 3;
    pointer-events: none;
}

.avatar-ok svg { color: var(--green); filter: drop-shadow(0 0 6px rgba(124,255,178,0.5)); }

.avatar.has-img .avatar-ok { opacity: 1; transform: scale(1); }

/* Drag states */
.avatar.dragover { transform: scale(1.06); }
.avatar.dragover .avatar-ring { animation-duration: 1s; }

.avatar.error .avatar-ring {
    background: conic-gradient(from 0deg, var(--red), #ff6b6b, var(--red));
}

/* Error text */
.avatar-err {
    font-size: 0.7rem;
    color: var(--red);
    margin-top: 8px;
    min-height: 0; max-height: 0;
    overflow: hidden; opacity: 0;
    transition: all 0.25s;
}

.avatar-err:not(:empty) {
    min-height: 14px; max-height: 20px;
    opacity: 1; margin-top: 8px;
}

/* ============================================
   FIELDS
   ============================================ */
.field { margin-bottom: 14px; }

.field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-3);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 36px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: 0.85rem;
    transition: border-color 0.25s, background 0.25s;
    z-index: 1;
}

.input-wrap input::placeholder { color: transparent; }

.input-wrap input:focus {
    border-color: var(--border-focus);
    background: rgba(108,99,255,0.04);
    outline: none;
}

.input-wrap input:read-only {
    opacity: 0.65;
    cursor: default;
}

.input-wrap .fi {
    position: absolute;
    left: 11px;
    color: var(--text-3);
    pointer-events: none;
    z-index: 2;
    transition: color 0.25s;
}

.input-wrap input:focus ~ .fi { color: var(--primary); }

.focus-glow {
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--r) + 2px);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    z-index: 0;
    transition: opacity 0.3s;
    filter: blur(5px);
}

.input-wrap input:focus ~ .focus-glow { opacity: 0.08; }

/* ============================================
   DOB PICKER
   ============================================ */
.dob-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 8px;
}

.dob-sel { position: relative; }

.dob-sel select {
    width: 100%;
    height: 40px;
    padding: 0 28px 0 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.dob-sel select:focus {
    border-color: var(--border-focus);
    background: rgba(108,99,255,0.04);
    outline: none;
    box-shadow: 0 0 0 3px rgba(108,99,255,0.08);
}

.dob-sel select option {
    background: var(--surface);
    color: var(--text);
}

.dob-arrow {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 3.5px solid var(--text-3);
    pointer-events: none;
    transition: border-color 0.25s;
}

.dob-sel select:focus + .dob-arrow { border-top-color: var(--primary); }

.dob-hint {
    font-size: 0.68rem;
    color: var(--text-3);
    margin-top: 6px;
    display: block;
}

.dob-err {
    font-size: 0.7rem;
    color: var(--red);
    min-height: 0; max-height: 0;
    overflow: hidden; opacity: 0;
    transition: all 0.25s;
}

.dob-err:not(:empty) {
    min-height: 14px; max-height: 20px;
    opacity: 1; margin-top: 4px;
}

/* ============================================
   CONTINUE BUTTON
   ============================================ */
.btn-go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    margin-top: 6px;
    background: linear-gradient(135deg, var(--primary), #847AFF);
    border: none;
    border-radius: var(--r);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
    box-shadow: 0 4px 16px rgba(108,99,255,0.25);
}

.btn-go::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: inherit;
}

.btn-go:hover::before { opacity: 1; }
.btn-go:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(108,99,255,0.35);
}
.btn-go:active { transform: translateY(0) scale(0.98); }
.btn-go:disabled { pointer-events: none; opacity: 0.5; }

.btn-text, .btn-icon { position: relative; z-index: 1; }

.btn-load {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: 2;
}

.btn-go.loading .btn-text,
.btn-go.loading .btn-icon { opacity: 0; visibility: hidden; }
.btn-go.loading .btn-load { opacity: 1; visibility: visible; }
.btn-go.loading { pointer-events: none; }

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

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

/* Ripple */
.btn-go .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: scale(0);
    animation: ripplePop 0.5s ease-out;
    pointer-events: none;
    z-index: 1;
}

@keyframes ripplePop { to { transform: scale(4); opacity: 0; } }

/* ============================================
   SKIP
   ============================================ */
.skip {
    text-align: center;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-3);
}

.skip a {
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.skip a::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 0; height: 1px;
    background: var(--text-2);
    transition: width 0.3s var(--ease);
}

.skip a:hover { color: var(--text-2); }
.skip a:hover::after { width: 100%; }

/* ============================================
   TOAST
   ============================================ */
#toast-wrap {
    position: fixed; top: 20px; right: 20px;
    z-index: 10000;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    border-radius: var(--r);
    background: rgba(15,18,40,0.95);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
    max-width: 320px;
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    animation: tIn 0.35s var(--ease) forwards;
}

.toast.removing { animation: tOut 0.3s var(--ease) forwards; }

.toast-icon {
    flex-shrink: 0;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem;
}

.toast.error .toast-icon {
    background: rgba(255,71,87,0.15); color: var(--red);
    border: 1px solid rgba(255,71,87,0.3);
}

.toast.success .toast-icon {
    background: rgba(124,255,178,0.15); color: var(--green);
    border: 1px solid rgba(124,255,178,0.3);
}

.toast-x {
    margin-left: auto;
    background: none; border: none;
    color: var(--text-3); cursor: pointer;
    padding: 2px; font-size: 0.85rem;
    transition: color 0.2s;
}

.toast-x:hover { color: var(--text); }

@keyframes tIn {
    from { opacity: 0; transform: translateX(24px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes tOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(24px) scale(0.96); }
}

/* ============================================
   SHAKE
   ============================================ */
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-4px); }
    40%,80% { transform: translateX(4px); }
}

/* ============================================
   MOBILE LOGO — hidden desktop
   ============================================ */
.mob-logo {
    display: none;
    text-align: center;
    margin-bottom: 16px;
}

.mob-logo a {
    display: inline-block;
    filter: drop-shadow(0 0 12px rgba(108,99,255,0.4));
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
    body { height: auto; min-height: 100dvh; overflow: auto; }

    .layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100dvh;
    }

    .left { display: none; }
    .mob-logo { display: block; }

    .right {
        border-left: none;
        padding: 24px 20px;
        min-height: 100dvh;
        align-items: flex-start;
        padding-top: 40px;
    }

    .card { max-width: 400px; margin: 0 auto; }
}

@media (max-width: 480px) {
    .right { padding: 16px 14px; padding-top: 32px; }
    .card { padding: 22px 18px; }
    .avatar { width: 84px; height: 84px; }
}
