/* The one design system for the whole app and the landing.
   Adapted from the course.personalabs theme (C:\repos\stud\course-cabinet\app\site\css\style.css):
   Google Antigravity look. Light only, white ground, black text, one purple accent plus a
   4-stop rainbow gradient used on fills only, Google Sans Flex, big radii, soft shadows,
   floating particle field behind everything. No dark theme, no emoji. */

:root {
  --color-primary: #000000;
  --color-secondary: #ffffff;
  --color-text: #000000;
  --color-text-secondary: #5f6368;
  --color-text-muted: #9aa0a6;
  --color-border: #e0e0e0;
  --color-border-light: #f0f0f0;
  --gradient-accent: linear-gradient(115deg, #4b7bec 0%, #8e44ad 36%, #ff4444 70%, #ff9e3d 100%);
  --gradient-size: 190% 100%;
  --color-accent: #8e44ad;
  --color-accent-bg: rgba(142, 68, 173, 0.07);
  --color-accent-glow: rgba(142, 68, 173, 0.30);
  --color-warn: #ea8600;
  --color-warn-bg: rgba(234, 134, 0, 0.06);
  --color-ok: #1f9d57;
  --font-sans: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --radius: 16px;
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--color-secondary);
  color: var(--color-text);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-weight: 450; letter-spacing: -0.02em; margin: 0 0 0.4em; }
h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; font-weight: 500; }
p { margin: 0 0 1em; }
.muted { color: var(--color-text-secondary); }
.faint { color: var(--color-text-muted); }
.label {
  font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--color-text-muted);
}

/* particle field behind everything */
#particle-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
  mask-image: linear-gradient(to right, #000 0, #000 calc(50% - 470px),
    rgba(0,0,0,0.45) calc(50% - 300px), rgba(0,0,0,0.45) calc(50% + 300px),
    #000 calc(50% + 470px), #000 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(50% - 470px),
    rgba(0,0,0,0.45) calc(50% - 300px), rgba(0,0,0,0.45) calc(50% + 300px),
    #000 calc(50% + 470px), #000 100%);
}
@media (max-width: 1279px) { #particle-canvas { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { #particle-canvas { opacity: 0.35; } }
.above { position: relative; z-index: 10; }

/* buttons */
.btn {
  font-family: var(--font-sans); border: none; border-radius: 999px; padding: 0.85rem 1.7rem;
  font-size: 0.98rem; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center;
  gap: 0.55rem; transition: transform 0.2s ease, box-shadow 0.2s ease, background-position 0.45s ease,
  background 0.15s ease; line-height: 1;
}
.btn-primary {
  background: var(--gradient-accent); background-size: var(--gradient-size); background-position: 0% 50%;
  color: #fff; box-shadow: 0 8px 24px var(--color-accent-glow);
}
.btn-primary:hover { background-position: 100% 50%; transform: translateY(-2px); box-shadow: 0 12px 30px var(--color-accent-glow); }
.btn-dark { background: var(--color-primary); color: #fff; }
.btn-dark:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.btn-ghost { background: transparent; color: var(--color-text); border: 1.5px solid var(--color-text); }
.btn-ghost:hover { background: rgba(0,0,0,0.05); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.86rem; }
.btn[disabled] { opacity: 0.5; cursor: default; }

/* cards */
.card {
  background: var(--color-secondary); border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.card.hover:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.1); border-color: transparent; }
.grid { display: grid; gap: 20px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* pills / chips */
.pill { display: inline-block; font-size: 0.74rem; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--color-border); color: var(--color-text-secondary); }
.pill.ok { border-color: var(--color-accent-glow); background: var(--color-accent-bg); color: var(--color-accent); }
.pill.warn { border-color: rgba(234,134,0,0.35); background: var(--color-warn-bg); color: var(--color-warn); }

/* tables */
table.grid-table { width: 100%; border-collapse: collapse; font-size: 0.92rem;
  background: var(--color-secondary); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-border); }
table.grid-table thead th { background: rgba(0,0,0,0.03); font-weight: 500; text-align: left; padding: 12px 16px;
  border-bottom: 1px solid var(--color-border); font-size: 0.78rem; color: var(--color-text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em; }
table.grid-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--color-border-light); vertical-align: top; }
table.grid-table tbody tr:hover { background: rgba(0,0,0,0.02); }

/* forms */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 0.78rem; color: var(--color-text-secondary); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.04em; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=time],
textarea, select {
  width: 100%; font-family: var(--font-sans); font-size: 0.95rem; padding: 11px 14px;
  border: 1px solid var(--color-border); border-radius: 11px; background: #fff; color: var(--color-text);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-bg); }

/* gradient bar (progress / meters) */
.bar { height: 8px; border-radius: 999px; background: var(--color-border-light); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gradient-accent); background-size: var(--gradient-size); }

/* ============ APP SHELL ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 56px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 18px;
  padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand .mark { width: 26px; height: 26px; }
.spacer { flex: 1; }
.who { font-size: 0.9rem; color: var(--color-text-secondary); }

.tabs { display: flex; gap: 4px; overflow-x: auto; }
.tab {
  padding: 8px 14px; border-radius: 999px; font-size: 0.92rem; font-weight: 500; white-space: nowrap;
  color: var(--color-text-secondary); cursor: pointer; border: 1px solid transparent; transition: 0.15s;
}
.tab:hover { color: var(--color-text); background: rgba(0,0,0,0.04); }
.tab.active { color: #fff; background: var(--gradient-accent); background-size: var(--gradient-size); }

.shell { max-width: var(--max-width); margin: 0 auto; padding: 88px 24px 80px; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 22px; }
.subnav .tab { font-size: 0.86rem; padding: 6px 12px; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 18px; }

/* ============ LOGIN MODAL ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000; background: rgba(20,20,25,0.35);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 22px; padding: 34px 30px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 70px rgba(30,33,60,0.28); border: 1px solid var(--color-border-light);
}
.modal h2 { margin-bottom: 6px; }
.modal .modal-sub { color: var(--color-text-secondary); font-size: 0.95rem; margin-bottom: 20px; }
.modal .btn { width: 100%; justify-content: center; margin-top: 8px; }
.modal .or { text-align: center; color: var(--color-text-muted); font-size: 0.8rem; margin: 14px 0 6px;
  text-transform: uppercase; letter-spacing: 0.08em; }
.modal .err { color: #d13438; font-size: 0.86rem; min-height: 1.2em; margin-top: 8px; }
.modal .x { position: absolute; }

/* ============ LANDING ============ */
.landing { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.hero { min-height: 82vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; }
.hero .badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--color-border); font-size: 0.82rem; color: var(--color-text-secondary); margin-bottom: 26px; }
.hero h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 450; letter-spacing: -0.03em; line-height: 1.02; }
.hero .grad { background: var(--gradient-accent); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; }
.hero .sub { font-size: 1.15rem; color: var(--color-text-secondary); max-width: 620px; margin: 18px auto 30px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.landing section { padding: 60px 0; border-top: 1px solid var(--color-border-light); }
.cabmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-top: 26px; }
.cabmap .card h3 { display: flex; align-items: center; gap: 10px; }
.cabmap .ic { width: 30px; height: 30px; flex: none; color: var(--color-accent); }
.cabmap .ru { font-weight: 500; }
.tool-note { margin-top: 22px; padding: 18px 22px; border-left: 3px solid var(--color-accent);
  background: var(--color-accent-bg); border-radius: 0 var(--radius) var(--radius) 0; color: var(--color-text-secondary); }

.foot { padding: 40px 0 60px; color: var(--color-text-muted); font-size: 0.85rem; text-align: center; }

/* muscle body map (bodymap.js), adapted to the light theme. Coloring is driven by --heat
   and the is-primary/is-secondary classes paintHeat() sets. */
.bodymap { width: 190px; height: auto; max-width: 44vw; }
.bodymap .silhouette { fill: #eef1f5; stroke: #d7dbe2; stroke-width: 1; }
.bodymap .muscle { fill: #e2e6ec; stroke: #cfd4dc; stroke-width: .7; transition: fill .25s; cursor: pointer; }
.bodymap .muscle.is-secondary { fill: color-mix(in srgb, #ea8600 calc(var(--heat, 0) * 100%), #e2e6ec); }
.bodymap .muscle.is-primary { fill: color-mix(in srgb, #e5484d calc(var(--heat, 0) * 100%), #e2e6ec); stroke: #d98a8a; }
.bodymap .muscle.is-sore { fill: color-mix(in srgb, #8e44ad calc(var(--heat, 0) * 100%), #e2e6ec); }
.bodymap .muscle:hover { stroke: var(--color-text); stroke-width: 1.4; }
.bw { text-align: center; }

/* small helpers */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.stat { font-size: 1.9rem; font-weight: 450; letter-spacing: -0.02em; }
.hide { display: none !important; }
.center { text-align: center; }
