/* ═══════════════════════════════════════
   VINTED TRACKER — DESIGN SYSTEM v2
   Dark, premium, SaaS-ready.
   ═══════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap");

:root {
    /* Surfaces */
    --bg:        #0a0b10;
    --bg-2:      #0f1119;
    --bg-3:      #151827;
    --bg-4:      #1c2032;
    --border:    #262b41;
    --border-2:  #333955;

    /* Text */
    --text:      #f0f2f8;
    --text-2:    #a8afc7;
    --text-3:    #6b7290;

    /* Brand */
    --brand:     #7c5cff;
    --brand-2:   #a855f7;
    --brand-3:   #ec4899;
    --brand-grad: linear-gradient(135deg, #7c5cff 0%, #a855f7 50%, #ec4899 100%);
    --brand-glow: 0 8px 32px rgba(124, 92, 255, 0.35);

    /* Semantic */
    --success:   #10b981;
    --warn:      #f59e0b;
    --danger:    #ef4444;
    --info:      #3b82f6;
    --deal:      #10b981;

    /* Shape */
    --r-sm:  8px;
    --r:     12px;
    --r-lg:  16px;
    --r-xl:  24px;

    /* Shadows */
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.35);
    --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
    color-scheme: dark;
    scroll-behavior: smooth;
    /* Kill the flash of overscroll on macOS/Chrome */
    background: var(--bg);
    /* Consistent easing tokens for the whole app */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-fast: 150ms;
    --dur: 220ms;
    --dur-slow: 400ms;
}
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    /* Ambient gradient stays with the document flow — background-attachment:fixed
       forces a full-viewport repaint on every scroll frame and tanks perf on
       mobile. The landing page has its own fixed .aurora layer which is cheaper
       (transform-only, GPU-composited). */
    background:
        radial-gradient(1200px 800px at 12% -10%, rgba(124, 92, 255, 0.12), transparent 60%),
        radial-gradient(1000px 700px at 90% 10%, rgba(236, 72, 153, 0.09), transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    /* Force GPU compositing on the root so descendant `transform` animations
       don't trigger a re-layout at the top of the tree. */
    transform: translateZ(0);
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

::selection { background: rgba(124, 92, 255, 0.4); color: white; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-2); }

/* ─── Typography ─────────────────────────── */
h1, h2, h3, h4 {
    margin: 0 0 12px;
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p  { margin: 0 0 12px; color: var(--text-2); }
a  { color: inherit; text-decoration: none; transition: color var(--dur) var(--ease-out); }
a:hover { color: var(--brand); }
small, .muted { color: var(--text-3); font-size: 13px; }
code {
    font-family: "SFMono-Regular", ui-monospace, Consolas, monospace;
    background: var(--bg-3);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.9em;
}

/* ─── Layout helpers ─────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.stack    { display: flex; flex-direction: column; gap: 12px; }
.row      { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer   { flex: 1; }
.center   { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

/* ─── Cards ──────────────────────────────── */
.card {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    box-shadow: var(--shadow-1);
}
.card + .card { margin-top: 16px; }

/* ─── Buttons ─────────────────────────────── */
.btn, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--brand-grad);
    color: white;
    border: none;
    padding: 11px 20px;
    border-radius: var(--r-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform var(--dur) var(--ease-out),
        box-shadow var(--dur) var(--ease-out),
        background-color var(--dur) var(--ease-out),
        opacity var(--dur-fast) linear;
    box-shadow: var(--shadow-1);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
    will-change: transform;
}
.btn:hover, button:hover { transform: translateY(-2px); box-shadow: var(--brand-glow); text-decoration: none; }
.btn:active, button:active { transform: translateY(0) scale(0.98); transition-duration: 80ms; }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.ghost {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn.ghost:hover { background: var(--bg-4); border-color: var(--border-2); box-shadow: none; }
.btn.outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-2);
    box-shadow: none;
}
.btn.outline:hover { background: rgba(124, 92, 255, 0.08); border-color: var(--brand); color: var(--brand); box-shadow: none; }
.btn.danger  { background: linear-gradient(135deg, #ef4444, #f87171); }
.btn.success { background: linear-gradient(135deg, #10b981, #34d399); }
.btn.small   { padding: 6px 12px; font-size: 12px; }
.btn.large   { padding: 14px 28px; font-size: 15px; }
.btn.block   { display: flex; width: 100%; }

/* ─── Forms ───────────────────────────────── */
input, select, textarea {
    background: var(--bg-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 11px 14px;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:hover, select:hover, textarea:hover { border-color: var(--border-2); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.2);
}
label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
input[type="checkbox"] { width: auto; accent-color: var(--brand); }

/* ─── Badges ─────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: var(--bg-4);
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.4;
}
.badge.deal    { background: rgba(16, 185, 129, 0.15); color: var(--deal); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge.brand   { background: var(--brand-grad); color: white; }
.badge.warn    { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.badge.info    { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.badge.danger  { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ─── Toasts ─────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}
.toast {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    padding: 12px 16px;
    border-radius: var(--r);
    box-shadow: var(--shadow-3);
    font-size: 13.5px;
    animation: slideIn .3s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.deal    { border-left-color: var(--deal); }
@keyframes slideIn {
    from { transform: translateX(120%); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes fadeInUp {
    from { transform: translateY(8px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}

/* ─── Auth pages ─────────────────────────── */
.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-3);
    animation: fadeInUp .4s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-card .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}
.auth-card .logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--brand-grad);
    display: grid; place-items: center;
    box-shadow: var(--brand-glow);
    font-weight: 800; color: white;
    font-family: "Space Grotesk", sans-serif;
}
.auth-card .logo-text {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700; font-size: 18px;
}
.auth-card h1 {
    font-size: 26px;
    margin-bottom: 6px;
}
.auth-card .sub { color: var(--text-2); margin-bottom: 26px; }
.auth-card .link-row {
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    margin-top: 8px;
}
.auth-card .link-row a { color: var(--brand); font-weight: 600; }

/* ─── Logo mark (reusable) ───────────────── */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}
.brand-logo .mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--brand-grad);
    display: grid; place-items: center;
    color: white; font-weight: 800; font-size: 14px;
    box-shadow: var(--brand-glow);
}

/* ─── Landing page ───────────────────────── */
.landing {
    min-height: 100vh;
    display: flex; flex-direction: column;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}
.nav .links { display: flex; gap: 24px; }
.nav .links a { color: var(--text-2); font-size: 14px; }
.nav .links a:hover { color: var(--text); }

.hero {
    max-width: 1100px;
    margin: 40px auto 60px;
    padding: 60px 24px;
    text-align: center;
}
.hero .pill {
    display: inline-flex; gap: 6px; align-items: center;
    background: rgba(124, 92, 255, 0.1);
    border: 1px solid rgba(124, 92, 255, 0.3);
    color: var(--brand);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    margin-bottom: 24px;
}
.hero h1 {
    font-size: clamp(36px, 6vw, 60px);
    margin-bottom: 20px;
    background: linear-gradient(180deg, var(--text) 0%, var(--text-2) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero h1 .grad {
    background: var(--brand-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: 18px;
    max-width: 620px;
    margin: 0 auto 32px;
    color: var(--text-2);
}
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.features {
    max-width: 1100px;
    margin: 40px auto 80px;
    padding: 0 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.feature {
    background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 24px;
    transition: transform .2s ease, border-color .2s ease;
}
.feature:hover { transform: translateY(-2px); border-color: var(--border-2); }
.feature .icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(124, 92, 255, 0.12);
    display: grid; place-items: center;
    color: var(--brand);
    margin-bottom: 16px;
    font-size: 22px;
}
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p  { font-size: 14px; color: var(--text-2); margin: 0; }

.footer {
    padding: 24px 40px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
    margin-top: auto;
}

/* ─── Empty states ───────────────────────── */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
}
.empty .icon {
    font-size: 42px;
    margin-bottom: 12px;
    opacity: 0.6;
}
.empty h3 { color: var(--text-2); margin-bottom: 6px; }

/* ─── Utilities ──────────────────────────── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.hidden { display: none !important; }
.grad-text {
    background: var(--brand-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
