/* TJ Walia Client Portal — clean, premium, trustworthy light theme
   Distinct from TJ's internal dark/navy properties (storm.tjwalia.com) on purpose:
   this is an external, client-facing surface. Same discipline, different mood. */

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

:root {
  --bg: #FAFAF8;
  --bg-card: #FFFFFF;
  --bg-soft: #F3F3F0;
  --ink-0: #10151C;
  --ink-1: #2B3340;
  --ink-2: #5B6573;
  --ink-3: #8891A0;
  --line: #E7E7E2;
  --line-hi: #D7D8D2;
  --navy: #0E2A43;
  --navy-ink: #123152;
  --cyan: #0E8FA3;
  --cyan-soft: #E4F4F6;
  --gold: #B8893A;
  --gold-soft: #F7EEDD;
  --green: #1D8A5B;
  --green-soft: #E4F5EC;
  --red: #C23A3A;
  --red-soft: #FBEAEA;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16,21,28,.05);
  --shadow-md: 0 8px 28px rgba(16,21,28,.08);
  --shadow-lg: 0 20px 48px rgba(16,21,28,.12);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --t: 180ms cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink-1);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- Layout shell ---------- */
.shell { display: flex; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: rgba(250,250,248,.88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: var(--navy); letter-spacing: -.01em; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--cyan) 130%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 13px; font-family: var(--mono);
  flex-shrink: 0;
}
.brand .sub { color: var(--ink-3); font-weight: 500; font-size: 12px; margin-left: 2px; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13.5px;
  color: var(--ink-2); transition: all var(--t);
}
.nav a:hover { background: var(--bg-soft); color: var(--ink-0); }
.nav a.active { background: var(--navy); color: #fff; }
.nav-toggle { display: none; }

.main {
  flex: 1; max-width: 920px; margin: 0 auto; width: 100%;
  padding: 40px 24px 80px;
}
.main.wide { max-width: 1040px; }
.main.narrow { max-width: 460px; padding-top: 64px; }

/* ---------- Typography ---------- */
h1 { font-size: 28px; font-weight: 800; color: var(--ink-0); letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 19px; font-weight: 700; color: var(--ink-0); letter-spacing: -.01em; margin: 0 0 4px; }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; display: block; }
.lede { color: var(--ink-2); font-size: 15px; margin: 0 0 28px; max-width: 54ch; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.card-head h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: .01em; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-hi);
  background: #fff; color: var(--ink-0); font: 500 14.5px var(--sans); transition: border-color var(--t), box-shadow var(--t);
}
input:focus, textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-soft); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: 14px;
  border: none; cursor: pointer; transition: all var(--t); letter-spacing: -.005em;
  width: 100%;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-ink); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: var(--bg-soft); color: var(--ink-1); }
.btn-ghost:hover { background: var(--line); }
.btn-link { width: auto; padding: 4px 0; background: none; color: var(--cyan); font-weight: 600; font-size: 13.5px; }

.auth-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 18px; padding: 36px 32px; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-logo .mark { margin: 0 auto 14px; width: 46px; height: 46px; border-radius: 13px; font-size: 18px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 13.5px; color: var(--ink-3); }

/* ---------- Alerts / badges ---------- */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; font-weight: 500; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--red-soft); color: var(--red); border: 1px solid rgba(194,58,58,.25); }
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid rgba(29,138,91,.25); }
.alert-info { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(14,143,163,.25); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.badge-active { background: var(--green-soft); color: var(--green); }
.badge-pending { background: var(--gold-soft); color: var(--gold); }
.badge-paused { background: var(--bg-soft); color: var(--ink-3); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Dashboard pieces ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 640px) { .stat-row { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat .v { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; }
.stat .l { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 4px; text-transform: uppercase; letter-spacing: .06em; }

.goal-item, .progress-item, .call-item, .doc-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.goal-item:last-child, .progress-item:last-child, .call-item:last-child, .doc-item:last-child { border-bottom: none; }
.item-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--bg-soft); color: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px;
}
.item-body { flex: 1; min-width: 0; }
.item-title { font-weight: 600; color: var(--ink-0); font-size: 14.5px; }
.item-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.item-action { flex-shrink: 0; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-3);
}
.empty-state .ico { font-size: 30px; margin-bottom: 10px; opacity: .5; }
.empty-state .t { font-weight: 600; color: var(--ink-2); font-size: 14.5px; margin-bottom: 4px; }
.empty-state .d { font-size: 13px; }

.doc-link { color: var(--cyan); font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; background: var(--cyan-soft); }
.doc-link:hover { background: var(--cyan); color: #fff; }

.booking-card {
  background: linear-gradient(135deg, var(--navy) 0%, #164463 100%); border-radius: var(--radius);
  padding: 28px; color: #fff; box-shadow: var(--shadow-md);
}
.booking-card .eyebrow { color: #8FD9E6; }
.booking-card h2 { color: #fff; }
.booking-card p { color: rgba(255,255,255,.75); font-size: 14px; margin: 8px 0 18px; }
.booking-card .btn-primary { background: #fff; color: var(--navy); }
.booking-card .btn-primary:hover { background: #F0F0EC; }

.skeleton { background: linear-gradient(90deg, var(--bg-soft) 25%, var(--line) 37%, var(--bg-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

footer.site { text-align: center; padding: 30px 20px; color: var(--ink-3); font-size: 12.5px; }

/* mobile nav */
@media (max-width: 760px) {
  .nav { display: none; position: fixed; top: 58px; left: 0; right: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 10px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); gap: 2px; z-index: 60; }
  .nav.open { display: flex; }
  .nav a { text-align: left; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-hi); background: #fff; cursor: pointer; }
}
