/* Dwelio — shared design system for the customer app and the admin console. */
:root {
  --blue-900: #0f2559;
  --blue-800: #12245c;
  --blue-700: #1b3f91;
  --blue-500: #2f6fed;
  --blue-100: #e8eefd;
  --blue-50: #f4f8ff;
  --ink: #101828;
  --muted: #5b6478;
  --border: #dfe4ee;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --success: #12805c;
  --warn: #9a5c00;
  --danger: #b3261e;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 37, 89, 0.08);
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
}
:root[data-theme="dark"] {
  --ink: #eef1f8;
  --muted: #aab3c8;
  --border: #26304a;
  --bg: #0b1220;
  --surface: #111a2e;
  --surface-2: #131e36;
  --blue-100: #16244a;
  --blue-50: #0f1a33;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-3); color: var(--muted); }
.price, .money, [data-money] { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 700; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 var(--space-5); }
@media (max-width: 640px) { .container { padding: 0 var(--space-4); } }

/* ── Top nav ─────────────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) var(--space-5); max-width: 1160px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 800; font-size: 1.1rem; text-decoration: none; }
.brand img { height: 32px; width: auto; }
.navlinks { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.navlinks a { text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem; padding: var(--space-2); border-radius: 8px; }
.navlinks a:hover, .navlinks a:focus-visible { background: var(--blue-100); outline: none; }
.navlinks a.active { color: var(--blue-700); }
.nav-actions { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.admin-pill { background: var(--blue-800); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; letter-spacing: 0.04em; }
.hamburger { display: none; }
@media (max-width: 860px) {
  .navlinks { position: fixed; inset: 60px var(--space-4) auto var(--space-4); background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-4); flex-direction: column; align-items: stretch; display: none; }
  .navlinks.open { display: flex; }
  .hamburger { display: inline-flex; }
}

/* ── Buttons & forms ─────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border-radius: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: transform .05s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--blue-500); outline: none; }
.btn-outline { background: transparent; color: var(--blue-700); border-color: var(--blue-700); }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--blue-100); outline: none; }
.btn-danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: #fff2f1; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
label { display: block; font-weight: 600; font-size: 0.85rem; margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-size: 0.95rem; font-family: inherit; }
textarea { min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.field { margin-bottom: var(--space-4); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.notice { border-radius: 10px; padding: 12px 14px; font-size: 0.88rem; margin-bottom: var(--space-4); }
.notice-warn { background: #fff6e6; color: var(--warn); border: 1px solid #f4dca3; }
.notice-error { background: #fdeceb; color: var(--danger); border: 1px solid #f3c6c2; }
.notice-ok { background: #e8f7f1; color: var(--success); border: 1px solid #b9e6d2; }
:root[data-theme="dark"] .notice-warn { background: #2a2110; }
:root[data-theme="dark"] .notice-error { background: #2c1414; }
:root[data-theme="dark"] .notice-ok { background: #0f2a20; }

/* ── Hero (CSS-crafted imagery — no external image files) ──────────────────── */
.hero { position: relative; color: #fff; padding: var(--space-8) 0 var(--space-7); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(47,111,237,.55), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(255,255,255,.12), transparent 55%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0px, rgba(255,255,255,.05) 2px, transparent 2px, transparent 44px),
    linear-gradient(120deg, var(--blue-900), var(--blue-700));
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.4rem); max-width: 780px; }
.hero p.lead { color: rgba(255,255,255,0.9); font-size: 1.15rem; max-width: 620px; }
.hero-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); }
.trust-badges { display: flex; gap: var(--space-5); margin-top: var(--space-7); flex-wrap: wrap; }
.trust-badges div { font-size: 0.85rem; color: rgba(255,255,255,0.85); }
.trust-badges strong { display: block; font-size: 1.5rem; color: #fff; }

/* ── Sections & cards ────────────────────────────────────────────────────── */
section { padding: var(--space-7) 0; }
.section-head { max-width: 640px; margin: 0 auto var(--space-6); text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.grid { display: grid; gap: var(--space-5); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow); display: flex; flex-direction: column; height: 100%; }
.card h3 { font-size: 1.05rem; }

/* CSS-crafted "art" thumbnails replacing photography — a distinct gradient + motif per step. */
.art-thumb { border-radius: 10px; margin-bottom: var(--space-3); aspect-ratio: 4/3; position: relative; overflow: hidden; }
.art-thumb::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 2px, transparent 2px 18px); }
.art-thumb.art-1 { background: radial-gradient(120% 140% at 0% 0%, var(--blue-500), var(--blue-900) 70%); }
.art-thumb.art-2 { background: radial-gradient(120% 140% at 100% 0%, #3ba0e0, var(--blue-800) 70%); }
.art-thumb.art-3 { background: radial-gradient(120% 140% at 50% 100%, var(--blue-700), #0a1636 75%); }

/* ── Pricing ─────────────────────────────────────────────────────────────── */
.pricing-card { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--space-3); }
.pricing-card .plan-name { font-weight: 700; font-size: 1.05rem; }
.pricing-card .plan-price { font-size: 2rem; font-weight: 800; color: var(--blue-700); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pricing-card .plan-price small { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.pricing-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.9rem; }
.pricing-card ul li::before { content: "✓ "; color: var(--success); font-weight: 700; }
.pricing-card.featured { border-color: var(--blue-700); box-shadow: 0 12px 32px rgba(27,63,145,0.18); }

/* ── Trust score chip ────────────────────────────────────────────────────── */
.score-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--blue-100); color: var(--blue-800); font-weight: 700;
  border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tier-new { background: var(--surface-2); color: var(--muted); }
.tier-top { background: #e6f6ec; color: var(--success); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--border); padding: var(--space-7) 0 var(--space-6); background: var(--surface-2); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-6); }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.footer-grid a { display: block; margin-bottom: 8px; text-decoration: none; color: var(--ink); font-size: 0.9rem; }
.footer-bottom { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3); font-size: 0.8rem; color: var(--muted); }
.credits { font-size: 0.72rem; color: var(--muted); max-width: 600px; }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.theme-toggle { min-height: 40px; min-width: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-size: 1.05rem; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.center { text-align: center; }
/* Tables can be wider than a 375px viewport — scope any overflow to a local scroller instead of
   letting it push out the document (the mobile.responsive gate measures document scrollWidth). */
.table-scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 560px; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: top; }
th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.badge-pending { background: #fff6e6; color: var(--warn); }
.badge-approved { background: #e6f6ec; color: var(--success); }
.badge-rejected { background: #fdeceb; color: var(--danger); }
.spinner { border: 3px solid var(--border); border-top-color: var(--blue-700); border-radius: 50%; width: 22px; height: 22px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: var(--space-6) 0; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; max-width: 100vw; overflow-x: hidden; }
main { flex: 1; min-width: 0; }

/* ── Admin console (distinct chrome, same design language) ─────────────────── */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; max-width: 100vw; }
.admin-side { background: var(--blue-900); color: #fff; padding: var(--space-5) var(--space-4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .brand { color: #fff; margin-bottom: var(--space-6); }
.admin-side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,0.82); text-decoration: none; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.admin-side nav a:hover, .admin-side nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.admin-main { padding: var(--space-6); background: var(--bg); min-width: 0; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); gap: var(--space-3); flex-wrap: wrap; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-4); }
.stat-card strong { font-size: 1.8rem; display: block; font-variant-numeric: tabular-nums; }
.module-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.module-on { background: var(--success); } .module-off { background: var(--danger); }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; }
}
