/* ============================================
   HIVE — Signup Page
   Premium Split-Screen Auth
   ============================================ */

:root {
    --bg: #050816;
    --bg-card: #0b0f2a;
    --primary: #6C63FF;
    --primary-dim: rgba(108,99,255,0.12);
    --secondary: #00E5FF;
    --accent: #FF4D9E;
    --green: #7CFFB2;
    --red: #FF4757;
    --amber: #FFB347;
    --text: #f0f0f5;
    --text-2: #A7B0C0;
    --text-3: #5a6378;
    --border: rgba(255,255,255,0.07);
    --border-focus: rgba(108,99,255,0.5);
    --r: 12px;
    --r-lg: 20px;
    --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; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
input { font: inherit; border: none; outline: none; background: none; }

/* --- Canvas --- */
#bg-canvas {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

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

/* --- Brand Panel (Left) --- */
.brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}

.brand-bg {
    position: absolute; inset: 0;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
}

.orb-1 {
    width: 400px; height: 400px;
    background: var(--primary);
    top: -100px; left: -80px;
    opacity: 0.4;
    animation: orbDrift 18s ease-in-out infinite;
}

.orb-2 {
    width: 300px; height: 300px;
    background: var(--accent);
    bottom: -60px; right: -40px;
    opacity: 0.3;
    animation: orbDrift 22s ease-in-out infinite reverse;
}

.orb-3 {
    width: 250px; height: 250px;
    background: var(--secondary);
    top: 40%; left: 50%;
    transform: translate(-50%,-50%);
    opacity: 0.2;
    animation: orbDrift 15s ease-in-out infinite;
    animation-delay: -5s;
}

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

.mesh-overlay {
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(108,99,255,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(255,77,158,0.06) 0%, transparent 50%);
}

.brand-content {
    position: relative; z-index: 2;
    max-width: 440px;
}

.brand-logo {
    display: inline-flex; align-items: center; gap: 10px;
    margin-bottom: 40px;
    font-family: var(--font-display);
    font-size: 1.3rem; font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-logo svg {
    filter: drop-shadow(0 0 16px rgba(108,99,255,0.4));
}

.brand-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.2vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

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

.brand-desc {
    font-size: 1.05rem;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 40px;
}

/* Testimonial Bubbles */
.testimonial-bubbles {
    display: flex; flex-direction: column;
    gap: 12px; margin-bottom: 44px;
}

.tbubble {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    font-size: 0.88rem;
    color: var(--text-2);
    width: fit-content;
    animation: bubbleSlide 0.6s var(--ease) backwards;
}

.tbubble img {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.08);
}

.tb-1 { animation-delay: 0.6s; }
.tb-2 { animation-delay: 0.8s; margin-left: 24px; }
.tb-3 { animation-delay: 1.0s; }

@keyframes bubbleSlide {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Stats */
.brand-stats {
    display: flex; align-items: center; gap: 24px;
}

.bs-item strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem; font-weight: 700;
}

.bs-item span {
    font-size: 0.78rem;
    color: var(--text-3);
}

.bs-divider {
    width: 1px; height: 32px;
    background: var(--border);
}

/* ============================================
   FORM PANEL (Right)
   ============================================ */
.form-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-left: 1px solid var(--border);
    background: rgba(11,15,42,0.5);
    backdrop-filter: blur(20px);
}

.form-scroll {
    width: 100%; max-width: 420px;
    max-height: 100vh;
    overflow-y: auto;
    padding: 20px 0;
}

.form-scroll::-webkit-scrollbar { width: 4px; }
.form-scroll::-webkit-scrollbar-track { background: transparent; }
.form-scroll::-webkit-scrollbar-thumb { background: rgba(108,99,255,0.2); border-radius: 2px; }

.form-container {
    width: 100%;
}

/* Mobile Logo */
.mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}

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

/* Header */
.form-header {
    margin-bottom: 32px;
}

.form-header h2 {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.form-header p {
    font-size: 0.92rem;
    color: var(--text-2);
    line-height: 1.55;
}

/* ============================================
   SOCIAL BUTTONS
   ============================================ */
.social-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 24px;
}

.btn-social {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 16px;
    border-radius: var(--r);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.88rem;
    transition: all 0.25s var(--ease);
    cursor: pointer;
}

.btn-social:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.14);
    transform: translateY(-1px);
}

.btn-social svg { flex-shrink: 0; }

/* ============================================
   DIVIDER
   ============================================ */
.divider {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 24px;
}

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

.divider span {
    font-size: 0.75rem;
    color: var(--text-3);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

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

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

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--text-3);
    transition: color 0.25s;
    pointer-events: none;
    z-index: 2;
}

.input-wrap input {
    width: 100%;
    height: 52px;
    padding: 0 14px 0 42px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: var(--r);
    color: var(--text);
    font-size: 0.92rem;
    transition: border-color 0.25s, background 0.25s;
    position: relative;
    z-index: 1;
}

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

.input-wrap label {
    position: absolute;
    left: 42px;
    top: 16px;
    font-size: 0.92rem;
    color: var(--text-3);
    pointer-events: none;
    transition: all 0.2s var(--ease);
    transform-origin: left center;
    z-index: 3;
}

.input-wrap input:focus ~ label,
.input-wrap input:not(:placeholder-shown) ~ label {
    top: 6px;
    font-size: 0.7rem;
    color: var(--primary);
    letter-spacing: 0.02em;
    font-weight: 500;
}

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

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

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

.input-wrap input:focus ~ .focus-ring {
    opacity: 0.1;
}

/* Valid */
.field.valid .input-wrap input {
    border-color: rgba(124,255,178,0.4);
}

.field.valid .input-wrap input:focus {
    border-color: var(--green);
}

.field.valid .input-wrap label { color: var(--green); }
.field.valid .field-icon { color: var(--green); }

/* Invalid */
.field.invalid .input-wrap input {
    border-color: rgba(255,71,87,0.4);
}

.field.invalid .input-wrap input:focus {
    border-color: var(--red);
}

.field.invalid .input-wrap label { color: var(--red); }
.field.invalid .field-icon { color: var(--red); }

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

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-5px); }
    40%,80% { transform: translateX(5px); }
}

/* Hint text */
.hint {
    display: block;
    font-size: 0.76rem;
    margin-top: 6px;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s var(--ease);
    color: var(--red);
    padding-left: 2px;
}

.hint:not(:empty) {
    min-height: 18px;
    max-height: 30px;
    opacity: 1;
    margin-top: 6px;
}

.field.valid .hint { color: var(--green); }

/* ============================================
   PASSWORD STRENGTH
   ============================================ */
.pw-strength {
    display: flex; align-items: center; gap: 10px;
    margin-top: 10px;
    opacity: 0; max-height: 0; overflow: hidden;
    transition: all 0.3s var(--ease);
}

.pw-strength.visible {
    opacity: 1; max-height: 30px;
}

.pw-bars {
    display: flex; gap: 4px; flex: 1;
}

.pw-bar {
    height: 3px; flex: 1;
    border-radius: 2px;
    background: rgba(255,255,255,0.06);
    transition: background 0.3s, box-shadow 0.3s;
}

.pw-bar.on {
    background: var(--red);
    box-shadow: 0 0 6px rgba(255,71,87,0.3);
}

.pw-bar.on.med {
    background: var(--amber);
    box-shadow: 0 0 6px rgba(255,179,71,0.3);
}

.pw-bar.on.strong {
    background: var(--green);
    box-shadow: 0 0 6px rgba(124,255,178,0.3);
}

.pw-label {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

/* ============================================
   PASSWORD TOGGLE
   ============================================ */
.toggle-pw {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: none;
    border: none;
    color: var(--text-3);
    transition: all 0.2s;
    z-index: 4;
    cursor: pointer;
}

.toggle-pw:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
button.btn-submit,
a.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 24px;
    margin-top: 8px;
    background: linear-gradient(135deg, var(--primary), #847AFF) !important;
    border: none !important;
    color: #fff !important;
    font-family: var(--font) !important;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--r);
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease);
    cursor: pointer;
    text-align: center;
    text-decoration: none !important;
}

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

button.btn-submit:hover::before,
a.btn-submit:hover::before {
    opacity: 1;
}

button.btn-submit:hover,
a.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(108,99,255,0.35);
}

button.btn-submit:active,
a.btn-submit:active {
    transform: translateY(0);
}

.btn-label, .btn-arrow { position: relative; z-index: 1; }

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

button.btn-submit.loading .btn-label,
button.btn-submit.loading .btn-arrow { opacity: 0; visibility: hidden; }
button.btn-submit.loading .btn-loading { opacity: 1; visibility: visible; }
button.btn-submit.loading { pointer-events: none; }

.spinner {
    width: 18px; height: 18px;
    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); } }

/* ============================================
   LOGIN TEXT
   ============================================ */
.login-text {
    text-align: center;
    margin-top: 22px;
    font-size: 0.88rem;
    color: var(--text-3);
}

.login-text a {
    color: var(--primary);
    font-weight: 600;
    position: relative;
    transition: color 0.2s;
}

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

.login-text a:hover { color: var(--secondary); }
.login-text a:hover::after { width: 100%; background: var(--secondary); }

/* ============================================
   TERMS
   ============================================ */
.terms {
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 16px;
    opacity: 0.6;
    line-height: 1.5;
}

.terms a {
    color: var(--text-3);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.terms a:hover { color: var(--text-2); }

/* ============================================
   SUCCESS OVERLAY
   ============================================ */
.success-overlay {
    position: fixed; inset: 0;
    background: rgba(5,8,22,0.92);
    backdrop-filter: blur(16px);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 0; visibility: hidden;
    transition: all 0.4s var(--ease);
}

.success-overlay.active { opacity: 1; visibility: visible; }

.success-modal {
    text-align: center;
    max-width: 380px; width: 100%;
    padding: 48px 36px;
    border-radius: var(--r-lg);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    backdrop-filter: blur(24px);
    transform: scale(0.92) translateY(20px);
    transition: transform 0.5s cubic-bezier(.34,1.56,.64,1);
}

.success-overlay.active .success-modal {
    transform: scale(1) translateY(0);
}

.success-icon { margin-bottom: 20px; }

.sm-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: drawCircle 0.7s ease-out 0.2s forwards;
}

.sm-check {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: drawCheck 0.4s ease-out 0.7s forwards;
}

@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

.success-modal h3 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.success-modal p {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 24px;
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

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

.toast.removing {
    animation: toastOut 0.35s var(--ease) forwards;
}

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

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

.toast.error {
    border-color: rgba(255, 71, 87, 0.2);
}

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

.toast.success {
    border-color: rgba(124, 255, 178, 0.2);
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.2s;
}

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

@keyframes toastIn {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(30px) scale(0.95); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .mobile-logo {
        display: block;
    }

    .form-panel {
        border-left: none;
        padding: 24px;
    }

    .form-scroll {
        max-height: none;
        padding: 0;
    }

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

    .social-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .form-panel { padding: 16px; }

    .form-header h2 { font-size: 1.4rem; }
}
