/* ============================================================
   The Ownership Level Scorecard — Elevation Church brand system
   ============================================================ */

:root {
  /* Brand palette (elevationng.org) */
  --color-primary: #1a699c;
  --color-primary-dark: #101e6d;
  --color-dark: #01142b;
  --color-accent: #c5d51a;
  --color-accent-dark: #9caa12;
  --color-primary-tint: #e8f2f9;
  --color-accent-tint: #f5f9d0;

  --color-bg: #ffffff;
  --color-surface: #f0f5fc;
  --color-border: #d9e4ef;
  --color-text: #1e1e1e;
  --color-text-muted: #6b6b68;
  --color-text-light: #ffffff;

  /* Category accent colours (S.F.D.A.E. + capstone) */
  --cat-see: #00a5ef;
  --cat-feel: #f6339a;
  --cat-decide: #ac4bff;
  --cat-act: #1a699c;
  --cat-evaluate: #00c758;
  --cat-capstone: #c9a227;

  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 3px 0 #00000014, 0 1px 2px -1px #0000000f;
  --shadow-lg: 0 20px 45px -20px rgba(1, 20, 43, 0.35);

  --font-sans: "Poppins", system-ui, -apple-system, sans-serif;
  --font-heading: "Montserrat", system-ui, -apple-system, sans-serif;
  --font-display: "Paytone One", system-ui, -apple-system, sans-serif;

  --ease-out-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background:
    radial-gradient(1200px 600px at 50% -10%, var(--color-primary-tint), transparent 60%),
    var(--color-surface);
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hide un-hydrated Alpine templates to prevent flash */
[x-cloak] { display: none !important; }

/* ---------- Layout ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px) clamp(16px, 4vw, 24px) 64px;
}

.brandbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 20px;
}
.brandbar img { height: 46px; width: auto; }

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 5vw, 40px);
}

/* ---------- Typography ---------- */
.h-display { font-family: var(--font-display); line-height: 1.05; letter-spacing: -0.01em; }
.h-heading { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; }
.eyebrow {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary);
}
.muted { color: var(--color-text-muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px 28px;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out-smooth), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-light);
  box-shadow: 0 10px 24px -12px rgba(26, 105, 156, 0.9);
}
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1.5px solid var(--color-border);
}
.btn-ghost:hover { border-color: var(--color-primary); background: var(--color-primary-tint); }
.btn-block { width: 100%; }
.btn-lg { padding: 16px 34px; font-size: 1.05rem; }

/* ---------- Progress ---------- */
.progress {
  height: 8px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}
.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: inherit;
  transition: width 0.4s var(--ease-out-smooth);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 22px;
}

/* ---------- Category chip ---------- */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
}
.cat-sub { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 8px; }

/* ---------- Statement ---------- */
.statement {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  line-height: 1.35;
  margin: 18px 0 26px;
}

/* ---------- Rating buttons ---------- */
.ratings { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.rating {
  position: relative;
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  padding: 16px 4px 12px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s var(--ease-out-smooth), border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.rating:hover { border-color: var(--color-primary); transform: translateY(-2px); }
.rating .num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-primary);
  display: block;
  line-height: 1;
}
.rating .lbl {
  display: block;
  font-size: 0.66rem;
  color: var(--color-text-muted);
  margin-top: 8px;
  font-weight: 500;
  min-height: 1.8em;
}
.rating.selected {
  border-color: var(--color-accent-dark);
  background: var(--color-accent-tint);
  box-shadow: 0 10px 22px -14px rgba(156, 170, 18, 0.9);
}
.rating.selected .num { color: var(--color-accent-dark); }

.nav-row { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; gap: 12px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 7px;
}
.field .req { color: var(--cat-feel); }
.input, .textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-tint);
}
.textarea { resize: vertical; min-height: 92px; }
.field-error { color: var(--cat-feel); font-size: 0.8rem; margin-top: 6px; font-weight: 500; }
.hint { color: var(--color-text-muted); font-size: 0.85rem; margin-top: 4px; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0 22px; }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--color-primary); flex: none; }
.consent label { font-size: 0.9rem; color: var(--color-text-muted); }

.subcard {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 18px;
}
.subcard h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}

/* ---------- Results ---------- */
.score-hero { text-align: center; padding: 8px 0 6px; }
.score-big {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 16vw, 5.5rem);
  color: var(--color-primary);
  line-height: 1;
}
.score-big small { font-size: 0.34em; color: var(--color-text-muted); font-family: var(--font-heading); }
.band-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(1.3rem, 5vw, 1.9rem);
  color: var(--color-primary-dark);
  margin-top: 6px;
}
.band-meaning { color: var(--color-text-muted); margin-top: 8px; }

.band-scale { display: flex; gap: 4px; margin: 22px 0 6px; }
.band-scale .seg { flex: 1; height: 8px; border-radius: var(--radius-full); background: var(--color-border); }
.band-scale .seg.on { background: var(--color-accent); }
.band-scale-labels { display: flex; justify-content: space-between; font-size: 0.62rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

.breakdown { margin-top: 26px; }
.breakdown h3 { font-family: var(--font-heading); font-size: 1.05rem; margin-bottom: 14px; }
.bar-row { margin-bottom: 16px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.bar-head .name { font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.04em; }
.bar-head .val { font-size: 0.82rem; color: var(--color-text-muted); font-weight: 500; }
.bar-track { height: 12px; background: var(--color-border); border-radius: var(--radius-full); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; transition: width 0.8s var(--ease-out-smooth); }
.bar-row.lowest .bar-head .name::after {
  content: "Growth edge";
  margin-left: 8px;
  font-size: 0.6rem;
  background: var(--color-accent-tint);
  color: var(--color-accent-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.callout {
  background: var(--color-primary-tint);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-top: 22px;
}
.callout .k { font-family: var(--font-heading); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-primary); }
.callout p { margin-top: 4px; }

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.result-actions .btn { flex: 1 1 auto; }

.notice {
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-top: 18px;
}
.notice.warn { background: #fff6e5; border: 1px solid #f0d59a; color: #7a5b12; }
.notice.ok { background: var(--color-accent-tint); border: 1px solid #dfe89a; color: var(--color-accent-dark); }

/* ---------- Spinner ---------- */
.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Fade transition ---------- */
.fade-enter { animation: fadeUp 0.35s var(--ease-out-smooth); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.footer-note { text-align: center; margin-top: 22px; font-size: 0.8rem; color: var(--color-text-muted); }

/* ---------- Responsive ---------- */
@media (max-width: 420px) {
  .ratings { gap: 6px; }
  .rating { padding: 12px 2px 10px; }
  .rating .num { font-size: 1.3rem; }
  .rating .lbl { font-size: 0.58rem; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .card { box-shadow: none; border: none; }
  .page { max-width: 100%; }
}
