:root {
    --bg-base: #0a0e1f;
    --fg: #e6ebff;
    --fg-muted: #94a0c4;
    --fg-faint: #6b7895;
    --primary: hsl(192, 95%, 60%);
    --primary-fg: #06121d;
    --border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(20, 28, 56, 0.4);
    --glass-strong-bg: rgba(20, 28, 56, 0.6);
    --danger: hsl(0, 80%, 65%);
    --success: hsl(160, 70%, 55%);
    --font-display: 'Sora', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-base);
    color: var(--fg);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

body {
    position: relative;
    overflow-x: hidden;
}

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

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
    animation: drift 18s ease-in-out infinite;
}

.orb-cyan {
    width: 520px; height: 520px;
    top: -160px; left: -120px;
    background: radial-gradient(circle, hsla(192, 95%, 60%, 0.55), transparent 70%);
}

.orb-purple {
    width: 600px; height: 600px;
    top: 20px; right: -200px;
    background: radial-gradient(circle, hsla(270, 85%, 65%, 0.55), transparent 70%);
    animation-delay: -6s;
}

.orb-pink {
    width: 480px; height: 480px;
    bottom: -160px; left: 30%;
    background: radial-gradient(circle, hsla(330, 90%, 60%, 0.40), transparent 70%);
    animation-delay: -12s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -30px) scale(1.05); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.page {
    position: relative;
    z-index: 1;
    padding: 48px 16px;
}

@media (min-width: 640px) {
    .page { padding: 48px 24px; }
}

.brand-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(48px, 7vw, 64px);
    letter-spacing: -0.04em;
    margin: 0 0 12px;
    background-image: linear-gradient(135deg, hsl(192 95% 65%) 0%, hsl(270 85% 70%) 50%, hsl(330 90% 70%) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.muted { color: var(--fg-muted); }
.muted-sm { color: var(--fg-muted); font-size: 0.85rem; margin: 4px 0 0; }

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border: 1px solid var(--border);
}

.glass-strong {
    background: var(--glass-strong-bg);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid var(--border);
    box-shadow: 0 32px 64px -32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

.card {
    border-radius: 24px;
    padding: 24px;
}

@media (min-width: 640px) {
    .card { padding: 32px; }
}

.card-spaced > * + * { margin-top: 20px; }

.card-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 500;
}

.hidden { display: none !important; }

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

.field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--fg);
}

input[type="text"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--fg);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
    min-height: 220px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    resize: vertical;
    border-radius: 16px;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(192, 95%, 60%, 0.2);
}

input::placeholder, textarea::placeholder {
    color: var(--fg-faint);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s, background 0.15s;
    color: var(--fg);
    background: transparent;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-lg { height: 48px; padding: 0 18px; font-size: 0.95rem; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 0.78rem; border-radius: 999px; }
.btn-block { width: 100%; }

.btn-primary {
    background: var(--primary);
    color: var(--primary-fg);
    box-shadow: 0 0 0 1px hsla(192, 95%, 70%, 0.5), 0 8px 32px hsla(192, 95%, 50%, 0.4);
}

.btn-glass {
    background: var(--glass-bg);
    border-color: var(--border);
    color: var(--fg);
}

.btn-glass:hover { background: rgba(255, 255, 255, 0.06); }

.btn-ghost {
    background: var(--glass-bg);
    border-color: var(--border);
    color: var(--fg);
}

.btn-gradient {
    background-image: linear-gradient(135deg, hsl(192 95% 55%) 0%, hsl(270 85% 60%) 50%, hsl(330 90% 60%) 100%);
    color: white;
    box-shadow: 0 0 0 1px hsla(270, 85%, 70%, 0.45), 0 12px 36px hsla(270, 85%, 50%, 0.4), inset 0 1px 0 hsla(220, 40%, 96%, 0.25);
    border: 0;
}

.btn-row {
    display: grid;
    gap: 12px;
}

.btn-row-3 {
    grid-template-columns: 1fr;
    padding-top: 4px;
}

@media (min-width: 640px) {
    .btn-row-3 { grid-template-columns: repeat(3, 1fr); }
}

.alert {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    font-size: 0.88rem;
}

.alert strong { display: block; margin-bottom: 4px; }
.alert .alert-msg { color: var(--fg-muted); }

.alert-error {
    border-color: hsla(0, 80%, 60%, 0.4);
    background: hsla(0, 80%, 50%, 0.08);
    color: var(--danger);
}

.alert-success {
    border-color: hsla(192, 95%, 50%, 0.3);
    background: hsla(192, 95%, 50%, 0.05);
    color: var(--primary);
}

.working {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
}

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Login layout */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-wrap {
    width: 100%;
    max-width: 440px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: hsla(192, 80%, 80%, 0.9);
}

.login-icon-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 4px;
}

.icon-square {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--glass-bg);
    border: 1px solid var(--border);
    color: hsl(192, 95%, 65%);
}

/* Home layout */
.home-wrap {
    max-width: 768px;
    margin: 0 auto;
}

.home-topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.home-header {
    text-align: center;
    margin-bottom: 32px;
}

.footer-note {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--fg-muted);
}
