/* BillMint shared design system — tokens, base, header, footer, buttons, forms.
   Page-specific styles live in landing.css / studio.css / editor.css.
   Dark is default; [data-theme="light"] overrides. Toggle sets data-theme on <html>. */

:root {
  --bg: #0b0f1a;
  --bg-elev: #121828;
  --bg-elev2: #1a2236;
  --card: #141b2e;
  --border: #26304a;
  --border-soft: #1e2740;
  --text: #eef2fb;
  --text-dim: #a9b4cc;
  --text-mut: #6f7c99;
  --brand: #4f8cff;
  --brand-2: #22d3a6;
  --brand-grad: linear-gradient(135deg, #4f8cff 0%, #22d3a6 100%);
  /* AA-safe gradient for white text on buttons: both stops >=4.5:1 vs #fff */
  --btn-grad: linear-gradient(135deg, #2f6bff 0%, #0b7d66 100%);
  --danger: #ff5d6c;
  --warn: #ffb020;
  --ok: #22d3a6;
  --ring: rgba(79, 140, 255, 0.45);
  --shadow: 0 10px 40px -12px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1160px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-elev: #ffffff;
  --bg-elev2: #eef2fa;
  --card: #ffffff;
  --border: #dce3f0;
  --border-soft: #e7ecf5;
  --text: #0e1424;
  --text-dim: #47536e;
  --text-mut: #7a869f;
  --brand: #2f6bff;
  --ring: rgba(47, 107, 255, 0.35);
  --shadow: 0 10px 34px -14px rgba(24, 39, 75, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.3rem); }
p { margin: 0 0 1rem; color: var(--text-dim); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-mut); }
.center { text-align: center; }

/* Focus + a11y */
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff; padding: 10px 16px; z-index: 200; }
.skip:focus { left: 8px; top: 8px; }

/* Header */
.hdr { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-soft); }
.hdr-in { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -0.03em; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 15px; }
.nav { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.nav a { color: var(--text-dim); font-weight: 500; font-size: .95rem; }
.nav a:hover { color: var(--text); text-decoration: none; }
.icon-btn { background: var(--bg-elev2); border: 1px solid var(--border); color: var(--text-dim); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; font-size: 16px; }
.icon-btn:hover { color: var(--text); border-color: var(--brand); }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav a:not(.btn) { display: none; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-weight: 600; font-size: .95rem; padding: 11px 20px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; transition: transform .06s ease, box-shadow .2s ease, background .2s ease; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--btn-grad); color: #fff; box-shadow: 0 6px 20px -6px var(--ring); }
.btn-primary:hover { box-shadow: 0 10px 28px -6px var(--ring); }
.btn-ghost { background: var(--bg-elev2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; border-radius: 13px; }
.btn-block { width: 100%; }

/* Cards / chips */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.badge-pro { background: linear-gradient(135deg,#ffb020,#ff7a45); color:#231400; border:none; }

/* Forms */
label { display: block; font-size: .84rem; font-weight: 600; color: var(--text-dim); margin: 0 0 6px; }
input, select, textarea {
  width: 100%; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
input::placeholder, textarea::placeholder { color: var(--text-mut); }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }

/* Footer */
.ftr { border-top: 1px solid var(--border-soft); margin-top: 80px; padding: 44px 0 34px; background: var(--bg-elev); }
.ftr-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 32px; }
.ftr h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-mut); margin-bottom: 14px; }
.ftr a { display: block; color: var(--text-dim); font-size: .92rem; margin-bottom: 9px; }
.ftr a:hover { color: var(--text); text-decoration: none; }
.ftr-bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border-soft); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-mut); font-size: .86rem; }
@media (max-width: 760px) { .ftr-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-elev2); color: var(--text); border: 1px solid var(--border); padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 300; font-weight: 500; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
