/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg:        #f4f6f9;
  --color-surface:   #ffffff;
  --color-border:    #e2e8f0;
  --color-text:      #1a202c;
  --color-muted:     #718096;
  --color-primary:   #2b6cb0;
  --color-primary-h: #2c5282;
  --color-success:   #276749;
  --color-warning:   #b7791f;
  --color-danger:    #c53030;
  --color-surf:      #1a9e6e;
  --radius:          8px;
  --shadow:          0 1px 4px rgba(0,0,0,.08);
  --font:            -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body { font-family: var(--font); background: var(--color-bg); color: var(--color-text); line-height: 1.6; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
main.container { padding-top: 2rem; padding-bottom: 4rem; }
.section { margin-top: 2.5rem; }
.section h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 1rem; }
.section--muted { color: var(--color-muted); font-size: .875rem; }

/* ── Navbar ───────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow);
}
.navbar__inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.navbar__brand { font-size: 1.2rem; font-weight: 700; color: var(--color-text); }
.navbar__links { display: flex; align-items: center; gap: 1.25rem; list-style: none; }
.navbar__links a { font-size: .9rem; color: var(--color-text); }
.navbar__toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

@media (max-width: 640px) {
  .navbar__links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--color-surface); padding: 1rem; border-bottom: 1px solid var(--color-border); }
  .navbar.open .navbar__links { display: flex; }
  .navbar__toggle { display: block; }
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { padding: 2.5rem 0 1rem; }
.hero h1 { font-size: 2rem; font-weight: 800; }
.hero__sub { color: var(--color-muted); margin-top: .25rem; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.card--highlight { border-left: 4px solid var(--color-primary); }
.card--surfable  { border-left: 4px solid var(--color-surf); }
.card--upgrade   { border: 1px dashed var(--color-border); background: #fffbeb; }
.card__label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--color-muted); }
.card__value { font-size: 2rem; font-weight: 700; line-height: 1.2; margin: .35rem 0; }
.card__unit  { font-size: 1rem; font-weight: 400; color: var(--color-muted); }
.card__meta  { font-size: .8rem; color: var(--color-muted); margin-top: .25rem; }

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  margin-top: .5rem;
}
.badge--green { background: #c6f6d5; color: var(--color-success); }
.badge--grey  { background: #e2e8f0; color: var(--color-muted); }
.badge--gold  { background: #fefcbf; color: #744210; }
.badge--blue  { background: #bee3f8; color: #2a4365; }

/* ── Chart ────────────────────────────────────────────────────────────────── */
.chart-wrapper {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem; font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer; transition: background .15s, color .15s;
  text-decoration: none;
}
.btn--primary  { background: var(--color-primary);   color: #fff; border-color: var(--color-primary); }
.btn--primary:hover { background: var(--color-primary-h); text-decoration: none; }
.btn--outline  { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn--outline:hover { background: #ebf4ff; text-decoration: none; }
.btn--danger   { color: var(--color-danger); border-color: var(--color-danger); background: transparent; }
.btn--danger:hover { background: #fff5f5; text-decoration: none; }
.btn--full     { width: 100%; }
.btn--sm       { padding: .3rem .8rem; font-size: .8rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1.25rem; }
.form--card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); max-width: 600px; }
.form__group { display: flex; flex-direction: column; gap: .35rem; }
.form__group--inline { flex-direction: row; align-items: flex-start; gap: 1rem; }
.form__group label { font-weight: 600; font-size: .9rem; }
.form__optional { font-weight: 400; color: var(--color-muted); font-size: .8rem; }
.form__hint  { font-size: .8rem; color: var(--color-muted); }
.form__value { font-size: .95rem; color: var(--color-text); }
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  padding: .55rem .85rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--color-primary); background: #fff; }

/* ── Toggle switch ────────────────────────────────────────────────────────── */
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle__slider {
  position: absolute; inset: 0;
  background: #cbd5e0; border-radius: 999px; cursor: pointer;
  transition: background .2s;
}
.toggle__slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle input:checked + .toggle__slider { background: var(--color-primary); }
.toggle input:checked + .toggle__slider::before { transform: translateX(20px); }
.toggle--sm { width: 36px; height: 20px; }
.toggle--sm .toggle__slider::before { width: 14px; height: 14px; }
.toggle--sm input:checked + .toggle__slider::before { transform: translateX(16px); }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash {
  padding: .75rem 1.25rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  font-size: .9rem;
  font-weight: 500;
}
.flash--success { background: #c6f6d5; color: var(--color-success); }
.flash--error   { background: #fed7d7; color: var(--color-danger); }
.flash--info    { background: #bee3f8; color: #2a4365; }

/* ── Auth box ─────────────────────────────────────────────────────────────── */
.auth-box {
  max-width: 440px; margin: 3rem auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.auth-box h1 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.auth-box__switch { margin-top: 1.25rem; font-size: .875rem; text-align: center; color: var(--color-muted); }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { padding: 1.5rem 0 .5rem; border-bottom: 1px solid var(--color-border); margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; }
.page-header p  { color: var(--color-muted); margin-top: .25rem; }

/* ── CTA box ──────────────────────────────────────────────────────────────── */
.cta-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-top: 2rem;
  text-align: center;
}
.cta-box h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.cta-box p  { color: var(--color-muted); margin-bottom: 1rem; }
.cta-box .btn { margin: 0 .4rem; }
.cta-box--sm { padding: 1.25rem; text-align: left; }

/* ── Pref list ────────────────────────────────────────────────────────────── */
.pref-list { list-style: none; font-size: .875rem; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .35rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--color-border); padding: 1.5rem 0; font-size: .8rem; color: var(--color-muted); margin-top: 3rem; }
