/* ==========================================================================
   Sotto v2 — shared design system (dark, premium SaaS)
   Used by every page (landing + dashboard). No build step, no dependencies.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #070b16;
  --bg2: #0b1120;
  --surface: #101a2e;
  --surface2: #16223a;
  --surface3: #1c2b47;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --ink: #eef1f6;
  --mid: #aab4c8;
  --dim: #6f7c95;
  --gold: #c4a265;
  --gold-2: #d4b87a;
  --gold-3: #e2cd98;
  --accent: #6366f1;
  --accent-2: #818cf8;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --radius: 16px;
  --maxw: 1140px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1100px 560px at 85% -10%, rgba(196, 162, 101, 0.10), transparent 60%),
    radial-gradient(900px 520px at -5% 4%, rgba(99, 102, 241, 0.12), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
::selection { background: rgba(196, 162, 101, 0.3); }
.tabular { font-variant-numeric: tabular-nums; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Scrollbar */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: #2a3c5e; }
* { scrollbar-width: thin; scrollbar-color: var(--surface3) transparent; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; font-size: 0.84rem; cursor: pointer;
  border-radius: 11px; padding: 9px 18px; border: 1px solid transparent;
  transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #0a0e1a;
  box-shadow: 0 8px 24px rgba(196, 162, 101, 0.28);
}
.btn-primary:hover { box-shadow: 0 10px 30px rgba(196, 162, 101, 0.4); transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--ink); border-color: var(--line2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn-subtle { background: transparent; color: var(--mid); }
.btn-subtle:hover { background: rgba(255,255,255,0.05); color: var(--ink); }
.btn-danger { background: rgba(248,113,113,0.9); color: #fff; }
.btn-danger:hover { background: var(--red); }
.btn-outline { border-color: rgba(196,162,101,0.4); background: rgba(196,162,101,0.06); color: var(--gold-2); }
.btn-outline:hover { background: rgba(196,162,101,0.14); }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; border-radius: 13px; }
.btn-sm { padding: 6px 12px; font-size: 0.76rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* Button shine sweep */
.btn-primary, .buy-btn { position: relative; overflow: hidden; }
.btn-primary::after, .buy-btn::after {
  content: ''; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg); transition: left 0.6s var(--ease);
}
.btn-primary:hover::after, .buy-btn:hover::after { left: 130%; }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 20px 50px -30px rgba(0,0,0,0.6);
}
.card-pad { padding: 20px; }
.card-int { transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s; }
.card-int:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: 0 26px 60px -28px rgba(0,0,0,0.7); }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px 12px;
}
.card-head .ch-l { display: flex; align-items: flex-start; gap: 12px; }
.card-head .ch-ic {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(196,162,101,0.12); color: var(--gold-2); border: 1px solid rgba(196,162,101,0.22);
}
.card-head h3 { font-size: 0.95rem; font-weight: 700; }
.card-head .sub { font-size: 0.82rem; color: var(--mid); margin-top: 2px; }

/* ── Badges / pills ────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; font-weight: 600; padding: 4px 10px; border-radius: 100px;
  background: rgba(255,255,255,0.08); color: var(--mid); border: 1px solid var(--line);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green { background: rgba(52,211,153,0.14); color: var(--green); border-color: rgba(52,211,153,0.25); }
.badge.amber { background: rgba(251,191,36,0.14); color: var(--amber); border-color: rgba(251,191,36,0.25); }
.badge.red { background: rgba(248,113,113,0.14); color: var(--red); border-color: rgba(248,113,113,0.25); }
.badge.gold { background: rgba(196,162,101,0.14); color: var(--gold-2); border-color: rgba(196,162,101,0.25); }
.badge.indigo { background: rgba(99,102,241,0.16); color: var(--accent-2); border-color: rgba(99,102,241,0.25); }

/* Pulsing dot */
.pulse-dot { position: relative; display: inline-flex; width: 9px; height: 9px; }
.pulse-dot::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: currentColor; opacity: 0.75; animation: ping 1.6s cubic-bezier(0,0,0.2,1) infinite;
}
.pulse-dot::after { content: ''; position: relative; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }

/* ── Forms ─────────────────────────────────────────────── */
.field { display: block; margin-bottom: 16px; }
.field > .lbl { display: block; font-size: 0.76rem; font-weight: 500; color: var(--mid); margin-bottom: 7px; }
.field > .hint { display: block; font-size: 0.74rem; color: var(--dim); margin-top: 7px; }
.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--line2); border-radius: 11px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 0.88rem;
  padding: 11px 14px; outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--dim); }
.input:hover, .select:hover { border-color: rgba(255,255,255,0.22); }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(196,162,101,0.15); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f7c95' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.select option { background: var(--bg2); color: var(--ink); }

/* Toggle */
.toggle { position: relative; display: inline-flex; align-items: center; width: 44px; height: 24px; border-radius: 999px; background: rgba(255,255,255,0.15); cursor: pointer; padding: 2px; transition: background 0.2s; flex-shrink: 0; border: none; }
.toggle .knob { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.toggle.on { background: var(--gold); }
.toggle.on .knob { transform: translateX(20px); }

/* ── Toasts ────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--surface2); border: 1px solid var(--line2); color: var(--ink); padding: 14px 18px; border-radius: 13px; font-size: 0.86rem; box-shadow: 0 16px 40px rgba(0,0,0,0.5); transform: translateX(130%); opacity: 0; transition: transform 0.4s var(--ease), opacity 0.4s; max-width: 360px; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-ic { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.7rem; font-weight: 800; }
.toast-ic.success { background: rgba(52,211,153,0.2); color: var(--green); }
.toast-ic.error { background: rgba(248,113,113,0.2); color: var(--red); }
.toast-ic.info { background: rgba(196,162,101,0.2); color: var(--gold-2); }
@media (max-width: 560px) { .toasts { left: 16px; right: 16px; bottom: 16px; } .toast { max-width: 100%; } }

/* ── Utilities ─────────────────────────────────────────── */
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; }
.mt8{margin-top:8px;} .mt12{margin-top:12px;} .mt16{margin-top:16px;} .mt24{margin-top:24px;}
.muted { color: var(--mid); } .dim { color: var(--dim); }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.09), rgba(255,255,255,0.04)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fade-in { animation: fadeIn 0.4s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 24px; border: 1px dashed var(--line2); border-radius: var(--radius); background: rgba(255,255,255,0.015); }
.empty .e-ic { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--mid); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.empty h4 { font-size: 0.95rem; font-weight: 600; }
.empty p { font-size: 0.85rem; color: var(--dim); margin-top: 6px; max-width: 340px; }

/* ── Auth pages ────────────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(160deg, rgba(196,162,101,0.10), rgba(99,102,241,0.08)), var(--bg2); border-right: 1px solid var(--line); }
.auth-side::before { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; top: -120px; right: -120px; background: radial-gradient(circle, rgba(196,162,101,0.30), transparent 70%); filter: blur(60px); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; position: relative; }
.auth-brand .lg { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; display: block; box-shadow: 0 6px 20px rgba(196,162,101,0.3); flex-shrink: 0; }
.auth-hero { position: relative; max-width: 420px; }
.auth-hero h2 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.auth-hero p { color: var(--mid); margin-top: 12px; }
.auth-hl { list-style: none; margin-top: 28px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.auth-hl li { display: flex; gap: 12px; align-items: flex-start; }
.auth-hl .ck { width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0; background: rgba(52,211,153,0.14); color: var(--green); display: flex; align-items: center; justify-content: center; }
.auth-hl b { font-weight: 600; font-size: 0.92rem; } .auth-hl span { display: block; font-size: 0.82rem; color: var(--mid); }
.auth-side .foot { position: relative; font-size: 0.78rem; color: var(--dim); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.auth-card .lead { color: var(--mid); font-size: 0.9rem; margin: 6px 0 26px; }
.auth-alt { text-align: center; font-size: 0.85rem; color: var(--mid); margin-top: 20px; }
.auth-alt a { color: var(--gold-2); font-weight: 600; }
.input-ic { position: relative; }
.input-ic svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.input-ic .input { padding-left: 40px; }
.demo-note { font-size: 0.78rem; color: var(--gold-2); background: rgba(196,162,101,0.08); border: 1px solid rgba(196,162,101,0.2); border-radius: 10px; padding: 10px 12px; margin-bottom: 18px; }
@media (max-width: 880px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ── iPhone / PWA fit ──────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain; }
@supports (padding: max(0px)) {
  .auth-side, .auth-main { padding-top: max(40px, env(safe-area-inset-top)); }
}

/* ── PWA bottom sheets (install guide + notifications) ──── */
.pwa-ov { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-end; justify-content: center; background: rgba(7,11,22,0.62); backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.pwa-ov.open { opacity: 1; pointer-events: auto; }
.pwa-sheet { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line2); border-bottom: none; border-radius: 24px 24px 0 0; padding: 14px 22px calc(24px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform 0.38s var(--ease); box-shadow: 0 -24px 70px rgba(0,0,0,0.55); }
.pwa-ov.open .pwa-sheet { transform: none; }
.pwa-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--line2); margin: 0 auto 16px; }
.pwa-hd { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.pwa-appicon img { border-radius: 13px; display: block; box-shadow: 0 6px 18px rgba(196,162,101,0.28); }
.pwa-hd h3 { font-size: 1.12rem; font-weight: 800; letter-spacing: -0.01em; }
.pwa-hd p { font-size: 0.84rem; color: var(--mid); margin-top: 2px; }
.pwa-sheet > h3 { font-size: 1.15rem; font-weight: 800; }
.pwa-sheet > p { font-size: 0.88rem; color: var(--mid); margin: 6px 0 18px; }
.pwa-steps { list-style: none; margin: 20px 0 14px; display: flex; flex-direction: column; gap: 15px; }
.pwa-steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; line-height: 1.45; }
.pwa-steps .n { flex-shrink: 0; width: 24px; height: 24px; border-radius: 8px; background: rgba(196,162,101,0.15); color: var(--gold-2); border: 1px solid rgba(196,162,101,0.25); display: flex; align-items: center; justify-content: center; font-size: 0.76rem; font-weight: 800; margin-top: 1px; }
.pwa-steps .ig { display: inline-flex; vertical-align: -4px; color: var(--gold-2); background: rgba(196,162,101,0.12); border-radius: 6px; padding: 2px; margin: 0 1px; }
.pwa-warn { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; color: var(--mid); line-height: 1.5; background: rgba(196,162,101,0.08); border: 1px solid rgba(196,162,101,0.2); border-radius: 12px; padding: 12px 14px; margin: 18px 0 14px; }
.pwa-warn svg { color: var(--gold-2); flex-shrink: 0; margin-top: 1px; }
.pwa-bell { width: 56px; height: 56px; border-radius: 16px; margin: 6px auto 14px; display: flex; align-items: center; justify-content: center; color: var(--gold-2); background: rgba(196,162,101,0.14); border: 1px solid rgba(196,162,101,0.25); }
.pwa-sheet .btn-block + .btn-block { margin-top: 8px; }
.pwa-arrow { position: fixed; left: 50%; bottom: calc(6px + env(safe-area-inset-bottom)); transform: translateX(-50%); color: var(--gold-2); animation: pwaBounce 1.4s ease-in-out infinite; pointer-events: none; filter: drop-shadow(0 4px 10px rgba(196,162,101,0.55)); }
@keyframes pwaBounce { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,9px); } }
@media (min-width: 560px) {
  .pwa-ov { align-items: center; }
  .pwa-sheet { border-radius: 22px; border-bottom: 1px solid var(--line2); padding-bottom: 24px; }
  .pwa-arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
