/* ============================================================
   Gruubuya — modern glassmorphism UI
   ============================================================ */

:root {
    --bg:            #0c0d1a;
    --bg-2:          #14162b;
    --glass:         rgba(255, 255, 255, 0.06);
    --glass-strong:  rgba(255, 255, 255, 0.10);
    --glass-border:  rgba(255, 255, 255, 0.14);
    --text:          #eef0ff;
    --text-dim:      #a8abce;
    --text-faint:    #6f7299;
    --primary:       #6d5efc;
    --primary-2:     #8b7bff;
    --primary-soft:  rgba(109, 94, 252, 0.16);
    --danger:        #ff5d73;
    --success:       #2fd17a;
    --warning:       #ffb84d;
    --radius:        18px;
    --radius-sm:     12px;
    --shadow:        0 20px 50px -20px rgba(0, 0, 0, 0.6);
    --ring:          0 0 0 3px rgba(109, 94, 252, 0.35);
    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: radial-gradient(1200px 800px at 15% -10%, #1c1f3d 0%, transparent 55%),
                radial-gradient(1000px 700px at 110% 10%, #241a45 0%, transparent 50%),
                var(--bg);
    /* keep the glow anchored to the viewport so the glass blur reads at any
       scroll position instead of fading to flat dark below the fold */
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- animated background orbs ---- */
.bg-orbs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    filter: blur(70px);
    opacity: 0.6;
}
.orb {
    position: absolute;
    width: 42vmax;
    height: 42vmax;
    border-radius: 50%;
    will-change: transform;
}
.orb-1 { background: #6d5efc; top: -12%; left: -10%;  animation: float1 18s var(--ease) infinite; }
.orb-2 { background: #ff5d9e; bottom: -18%; right: -8%; animation: float2 22s var(--ease) infinite; }
.orb-3 { background: #29c5ff; top: 35%; left: 45%;     animation: float3 26s var(--ease) infinite; }

@keyframes float1 { 50% { transform: translate(8vw, 10vh) scale(1.15); } }
@keyframes float2 { 50% { transform: translate(-10vw, -6vh) scale(1.1); } }
@keyframes float3 { 50% { transform: translate(-6vw, 8vh) scale(0.9); } }

@media (prefers-reduced-motion: reduce) {
    .orb { animation: none; }
}

/* ---- top bar ---- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: rgba(12, 13, 26, 0.55);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--glass-border);
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.3px;
    color: var(--text);
    text-decoration: none;
}
.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #ff5d9e);
    box-shadow: 0 0 14px var(--primary);
}
.topnav {
    display: flex;
    align-items: center;
    gap: 18px;
}
.topnav a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s var(--ease);
}
.topnav a:hover { color: var(--text); }

/* ---- layout ---- */
.page {
    flex: 1;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
    padding: 40px 20px 64px;
}
.sitefoot {
    padding: 24px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13px;
}

/* ---- glass card ---- */
.glass {
    background: var(--glass);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* auth screens: centered narrow card */
.auth-wrap {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    animation: rise 0.5s var(--ease) both;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.auth-card h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
}
.auth-sub {
    margin: 0 0 26px;
    color: var(--text-dim);
    font-size: 14.5px;
    line-height: 1.5;
}

/* ---- forms ---- */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}
.input {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.input::placeholder { color: var(--text-faint); }
.input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: var(--ring);
}
.input.has-error { border-color: var(--danger); }

/* password field with show/hide toggle */
.input-group { position: relative; }
.input-group .input { padding-right: 46px; }
.toggle-pass {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    font-size: 13px;
    transition: color 0.2s var(--ease);
}
.toggle-pass:hover { color: var(--text); }

.field-hint { margin: 7px 2px 0; font-size: 12.5px; color: var(--text-faint); }
.field-error { margin: 7px 2px 0; font-size: 12.5px; color: var(--danger); }

/* password strength meter */
.pw-meter { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.08); margin-top: 10px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 0.3s var(--ease), background 0.3s var(--ease); }
.pw-label { margin-top: 6px; font-size: 12px; color: var(--text-faint); }

/* ---- buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s var(--ease);
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: 13.5px; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 10px 24px -8px var(--primary);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px var(--primary); }
.btn-ghost {
    background: var(--glass);
    border-color: var(--glass-border);
}
.btn-ghost:hover { background: var(--glass-strong); }
.btn-danger {
    background: rgba(255, 93, 115, 0.14);
    border-color: rgba(255, 93, 115, 0.4);
    color: #ffd0d7;
}
.btn-danger:hover { background: rgba(255, 93, 115, 0.22); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---- links / meta rows ---- */
.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0 22px;
    font-size: 13px;
}
.link { color: var(--primary-2); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-dim);
}

/* divider */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-faint);
    font-size: 12px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
}

/* ---- flash messages ---- */
.flash-stack {
    position: fixed;
    top: 78px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
}
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    animation: slideIn 0.35s var(--ease) both;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } }
.flash-success { border-left: 3px solid var(--success); }
.flash-error   { border-left: 3px solid var(--danger); }
.flash-info    { border-left: 3px solid var(--primary-2); }
.flash-close {
    background: none; border: none; color: var(--text-dim);
    font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.flash-close:hover { color: var(--text); }

/* ---- dashboard / content cards ---- */
.stack { display: flex; flex-direction: column; gap: 22px; }
.content-card { padding: 28px; }
.content-card h2 { margin: 0 0 4px; font-size: 20px; }
.content-card .muted { color: var(--text-dim); font-size: 14px; margin: 0 0 20px; }

.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; }
.page-head p { margin: 0; color: var(--text-dim); }

/* profile info grid */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.info-item {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
}
.info-item .k { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; }
.info-item .v { font-size: 15.5px; margin-top: 4px; word-break: break-word; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-ok   { background: rgba(47, 209, 122, 0.15); color: var(--success); }
.badge-warn { background: rgba(255, 184, 77, 0.15); color: var(--warning); }

/* avatar */
.avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, var(--primary), #ff5d9e);
    box-shadow: 0 8px 20px -6px var(--primary);
}
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.profile-head h1 { margin: 0; font-size: 24px; }
.profile-head p { margin: 4px 0 0; color: var(--text-dim); font-size: 14px; }

/* hero (index) */
.hero { text-align: center; padding: 60px 20px; max-width: 640px; margin: 0 auto; }
.hero h1 { font-size: clamp(32px, 6vw, 52px); line-height: 1.1; margin: 0 0 18px; }
.hero .grad { background: linear-gradient(120deg, var(--primary-2), #ff8fc7); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17px; color: var(--text-dim); margin: 0 0 30px; line-height: 1.6; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---- responsive ---- */
@media (max-width: 560px) {
    .auth-card { padding: 28px 22px; }
    .info-grid { grid-template-columns: 1fr; }
    .flash-stack { left: 16px; right: 16px; max-width: none; }
    .topnav { gap: 12px; }
    .page { padding: 28px 16px 48px; }
}
