:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #eef1f9;
  --ink: #0d1526;
  --muted: #5c6579;
  --line: #e2e6f0;
  --brand: #4338ca;
  --brand-dark: #312e81;
  --brand-soft: #eef0ff;
  --accent: #0ea5b7;
  --ok: #0f9d63;
  --ok-soft: #e7f8f0;
  --warn: #b7791f;
  --warn-soft: #fdf5e6;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --shadow-sm: 0 1px 2px rgba(13, 21, 38, 0.06);
  --shadow-md: 0 12px 30px rgba(13, 21, 38, 0.08);
  --shadow-lg: 0 24px 60px rgba(13, 21, 38, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  font-size: 1rem;
}
.brand-text small {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.site-nav {
  display: flex;
  gap: 6px;
  margin-left: 12px;
}
.site-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 8px 12px;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.site-nav a.active { color: var(--brand); background: var(--brand-soft); }
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-user {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #5b4bff);
  color: #fff;
  box-shadow: 0 8px 18px rgba(67, 56, 202, 0.28);
}
.btn-primary:hover { box-shadow: 0 12px 24px rgba(67, 56, 202, 0.34); }
.btn-outline {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.btn-outline:hover { border-color: #c7cfe2; background: #fbfcff; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-sm { padding: 8px 13px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }

.inline-form { display: inline; margin: 0; }

/* Flash */
.flash {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 500;
}
.flash-success { border-color: #bfe9d4; background: var(--ok-soft); color: #0a6b47; }
.flash-error { border-color: #f3c3bd; background: var(--danger-soft); color: #9a2f24; }
.flash-info { border-color: #c8d2f7; background: var(--brand-soft); color: var(--brand-dark); }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 420px at 82% -10%, rgba(6, 182, 212, 0.26), transparent 60%),
    radial-gradient(700px 420px at 10% 0%, rgba(99, 102, 241, 0.32), transparent 55%),
    linear-gradient(160deg, #0a1022 0%, #101a35 55%, #0b1329 100%);
  color: #eef2ff;
  padding: 84px 0 96px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { color: #fff; }
.hero .lead { color: #c3cbe4; font-size: 1.12rem; max-width: 34em; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 22px; }
.hero .btn-outline { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.24); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,0.12); }
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  list-style: none;
  padding: 0;
  margin: 0;
  color: #aab5d4;
  font-size: 0.9rem;
}
.hero-points li::before { content: "✓"; color: var(--accent); margin-right: 7px; font-weight: 700; }

.hero-card { display: flex; justify-content: center; }
.mock-window {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  color: var(--ink);
  overflow: hidden;
  transform: rotate(-1.2deg);
}
.mock-bar { display: flex; gap: 6px; padding: 12px 14px; background: #f0f2f9; }
.mock-bar span { width: 9px; height: 9px; border-radius: 50%; background: #cdd3e4; }
.mock-body { padding: 20px 22px 22px; }
.mock-title { font-weight: 700; font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.mock-task {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 0;
  border-bottom: 1px solid #eef0f6;
  font-size: 0.9rem;
}
.mock-task .dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd2e2; }
.mock-task.done .dot { background: var(--ok); }
.mock-task.progress .dot { background: #e8a33d; }
.mock-task em { margin-left: auto; font-style: normal; font-size: 0.72rem; color: var(--muted); }
.mock-progress { height: 8px; border-radius: 99px; background: #eaedf6; margin: 16px 0 8px; overflow: hidden; }
.mock-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; }
.mock-meta { font-size: 0.78rem; color: var(--muted); margin: 0; }

/* Sections */
.section { padding: 72px 0; }
.section-alt { background: var(--surface-2); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head .lead { color: var(--muted); }
.page-hero {
  background: linear-gradient(160deg, #0a1022, #14203f);
  color: #eef2ff;
  padding: 64px 0 60px;
}
.page-hero h1 { color: #fff; }
.page-hero .lead { color: #c3cbe4; max-width: 42em; }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.grid > .card { height: 100%; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h2, .card-head h3 { margin: 0; font-size: 1.12rem; }
.icon-badge {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 14px;
}
.check-list { list-style: none; padding: 0; margin: 0 0 20px; }
.check-list li { position: relative; padding-left: 26px; margin-bottom: 9px; }
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ok);
  font-weight: 700;
}
.check-list.compact li { margin-bottom: 7px; font-size: 0.92rem; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.panel { background: linear-gradient(180deg, #fff, #fafbff); }

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.task-row:last-child { border-bottom: 0; }
.task-dot { width: 10px; height: 10px; border-radius: 50%; background: #c6cede; flex: none; }
.task-row.done .task-dot, .task-item.done .task-dot { background: var(--ok); }
.task-row.progress .task-dot, .task-item.progress .task-dot { background: #e8a33d; }
.task-name { flex: 1; }
.progress-bar { height: 9px; background: #e9edf7; border-radius: 99px; overflow: hidden; margin: 18px 0 10px; }
.progress-bar.lg { height: 11px; margin-top: 0; }
.progress-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--accent)); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-done { background: var(--ok-soft); color: #0a6b47; }
.badge-progress { background: var(--warn-soft); color: #8a5a12; }
.badge-todo { background: #eef0f6; color: #4d566b; }
.badge-cancelled { background: var(--danger-soft); color: #9a2f24; }

.tag {
  display: inline-block;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: 6px;
  vertical-align: middle;
}

.plan-card { display: flex; flex-direction: column; }
.plan-card .btn { margin-top: auto; align-self: flex-start; }
.plan-card-lg { padding: 32px; }
.plan-tagline { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.plan-ideal { color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); padding-top: 14px; margin-top: auto; }

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: linear-gradient(135deg, #111a32, #1c2a52);
  color: #fff;
  border-radius: 24px;
  padding: 44px;
  box-shadow: var(--shadow-md);
}
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band .lead { color: #c3cbe4; margin: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-band .btn-ghost { color: #fff; }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,0.12); }

/* Tables */
.table-wrap { overflow-x: auto; }
.compare, .data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.compare th, .compare td, .data-table th, .data-table td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.compare th, .data-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: #f8f9fd;
}
.compare td.yes, .data-table td.yes { color: var(--ok); font-weight: 600; }
.data-table td.right, .right { text-align: right; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table select, .data-table input { min-width: 120px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.85rem; font-weight: 600; color: #333c52; }
.field small { color: var(--muted); font-size: 0.78rem; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="url"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #cfd6e6;
  border-radius: 10px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.14);
}
input:disabled { background: #f4f6fb; color: var(--muted); }
textarea { resize: vertical; }
.field-group { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.auth-section { padding: 70px 0 90px; display: flex; justify-content: center; }
.auth-card { width: 100%; max-width: 520px; padding: 36px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-alt { margin-top: 20px; text-align: center; color: var(--muted); }
.error-code { font-size: 3.2rem; font-weight: 800; color: var(--brand); line-height: 1; margin: 0; }
.center { text-align: center; }

.notice { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--line); font-size: 0.92rem; }
.notice-warn { background: var(--warn-soft); border-color: #f0d9ac; color: #7a4e0f; }
.notice-ok { background: var(--ok-soft); border-color: #bfe9d4; color: #0a6b47; }
.notice code { background: rgba(0,0,0,0.06); padding: 1px 5px; border-radius: 4px; }

/* Dashboard */
.dashboard { padding-top: 36px; padding-bottom: 80px; }
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.dash-head h1 { margin-bottom: 4px; }
.dash-head .muted { margin: 0; }
.plan-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  box-shadow: var(--shadow-sm);
}
.plan-chip-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.plan-chip strong { font-size: 1.02rem; }

.subnav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-sm);
}
.subnav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.88rem;
}
.subnav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.subnav a.active { background: var(--brand); color: #fff; }

.stats { margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.stat-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.stat-value.small-value { font-size: 1.25rem; }

.stack-list { list-style: none; padding: 0; margin: 0; }
.stack-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.stack-list li:last-child { border-bottom: 0; }
.block { display: block; }

.task-list { display: flex; flex-direction: column; }
.task-list .task-row { padding: 10px 0; }
.task-list.detailed { gap: 2px; }
.task-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.task-item:last-child { border-bottom: 0; }
.task-title { display: flex; align-items: center; gap: 9px; }
.task-item-main p { margin: 4px 0 0 19px; font-size: 0.9rem; }
.task-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }

.meeting-item { align-items: flex-start; }
.meeting-item .badge { margin-top: 6px; }

.payment-list { display: flex; flex-direction: column; }
.payment-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}
.payment-item:last-child { border-bottom: 0; }
.payment-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.payment-item p { margin: 0 0 4px; }
.payment-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Admin task accordion */
.admin-task-list { display: flex; flex-direction: column; gap: 10px; }
.admin-task {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfdff;
  padding: 0 16px;
}
.admin-task[open] { background: #fff; box-shadow: var(--shadow-sm); }
.admin-task summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
  flex-wrap: wrap;
}
.admin-task summary::-webkit-details-marker { display: none; }
.admin-task-title { font-weight: 600; flex: 1; min-width: 140px; }
.admin-task-owner { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-task .form { padding: 4px 0 16px; }
.admin-task > form.inline-form { padding-bottom: 16px; }

/* Footer */
.site-footer { background: #0a1022; color: #9fa9c6; padding: 44px 0 34px; margin-top: 0; }
.footer-inner { display: flex; flex-direction: column; gap: 18px; }
.footer-brand { color: #fff; font-weight: 700; margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: #c3cbe4; font-size: 0.9rem; }
.footer-copy { margin: 0; font-size: 0.8rem; }

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.site-main { min-height: 60vh; }

/* Responsive */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { justify-content: flex-start; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 12px; padding: 10px 22px; }
  .brand-text small { display: none; }
  .site-nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .header-actions { gap: 6px; }
  .header-user { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .field-group { grid-template-columns: 1fr; }
  .section { padding: 52px 0; }
  .hero { padding: 60px 0 70px; }
  .cta-band { padding: 30px; }
  .auth-card { padding: 26px; }
  .task-item, .payment-item { flex-direction: column; }
  .task-item-side { align-items: flex-start; }
  .payment-actions { justify-content: flex-start; }
  .dash-head { flex-direction: column; }
  .compare, .data-table { font-size: 0.85rem; }
  .compare th, .compare td, .data-table th, .data-table td { padding: 10px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .btn:hover { transform: none; }
}
