/* =========================================================================
   Regalis Capital - SBA Buyer-Readiness Scorecard
   Standalone static styles. No framework, no build step.
   Design intent: premium buy-side M&A firm. Ink navy + restrained gold,
   warm paper background, serif display, clean sans body.
   ========================================================================= */

:root {
  /* Color system */
  --ink:        #0d2540;   /* deep navy, primary text + brand */
  --ink-deep:   #081a30;   /* darker navy for gradients */
  --ink-soft:   #33475b;   /* secondary text */
  --muted:      #6b7a8d;   /* tertiary text */
  --line:       #e4e0d7;   /* hairline borders on paper */
  --line-2:     #d8d3c7;

  --paper:      #f6f3ec;   /* warm off-white page */
  --paper-2:    #efeae0;
  --card:       #ffffff;   /* card surface */

  --gold:       #b08a45;   /* restrained accent */
  --gold-deep:  #916f31;
  --gold-tint:  #f3ecdd;

  /* Band colors (professional, not alarming) */
  --green:      #2f6b4f;
  --green-tint: #e7f0ea;
  --amber:      #a9762a;
  --amber-tint: #f6eddb;
  --rust:       #a5503a;
  --rust-tint:  #f4e7e2;

  /* Shape + motion */
  --radius:     18px;
  --radius-sm:  12px;
  --shadow:     0 1px 2px rgba(13,37,64,.04), 0 18px 44px -22px rgba(13,37,64,.28);
  --shadow-lift:0 1px 2px rgba(13,37,64,.05), 0 26px 60px -26px rgba(13,37,64,.36);
  --ease:       cubic-bezier(.22,.61,.36,1);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Soft background ornament */
.page-ornament {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 82% -8%, rgba(176,138,69,.10), transparent 60%),
    radial-gradient(900px 560px at -6% 108%, rgba(13,37,64,.07), transparent 58%);
}

/* ------------------------- Header / footer ------------------------- */
/* Dark navy bar so the white-and-gold Regalis logo reads correctly. */
.site-header {
  position: relative;
  z-index: 2;
  width: 100%;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-deep) 100%);
  border-bottom: 1px solid rgba(176, 138, 69, .28);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 40px);
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Logo is 5:1 (1000x200). Height drives it; width stays auto to hold ratio. */
.brand-logo { height: 40px; width: auto; display: block; }
.brand-tag {
  font-size: .70rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #c9ad72;
  font-weight: 600;
  text-align: right;
}

.site-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 26px 20px 32px;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.footer-dot { color: var(--line-2); }

/* ------------------------- App / screens ------------------------- */
.app {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 8px clamp(16px, 5vw, 28px) 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.screen { display: none; animation: screen-in .45s var(--ease) both; }
.screen.is-active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.screen.is-leaving { animation: screen-out .22s var(--ease) both; }
@keyframes screen-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}

/* ------------------------- Card ------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 40px);
}

/* ------------------------- Typography helpers ------------------------- */
.eyebrow {
  margin: 0 0 14px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  display: inline-flex;
  align-items: center;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1.5px;
  background: var(--gold);
  margin-right: 10px;
  display: inline-block;
}

.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.72rem, 5.6vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  color: var(--ink);
}
.hero-sub {
  font-size: 1.04rem;
  color: var(--ink-soft);
  margin: 0 0 26px;
  max-width: 46ch;
}

.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--ink);
}
.section-sub {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ------------------------- Hero list ------------------------- */
.hero-list {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: grid;
  gap: 14px;
}
.hero-list li {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  font-size: 1rem;
  color: var(--ink);
}
.tick {
  flex: none;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--gold-tint);
  position: relative;
}
.tick::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 6px;
  height: 11px;
  border: solid var(--gold-deep);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ------------------------- Buttons ------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn-lg { width: 100%; padding: 16px 22px; font-size: 1.02rem; }

.btn-primary {
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-deep) 100%);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(13,37,64,.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 34px -14px rgba(13,37,64,.68); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); transform: translateY(-2px); }

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  padding: 8px 4px;
  transition: color .18s var(--ease);
}
.btn-link:hover { color: var(--ink); }
.btn-link::before { content: "\2190"; margin-right: 6px; }

.reassure {
  margin: 14px 0 0;
  font-size: .82rem;
  color: var(--muted);
  text-align: center;
}

/* Subtle "skip the opt-in" text link under the contact submit button.
   Deliberately tiny + low-contrast so it never cannibalizes opt-ins,
   but underlined so it reads as clearly clickable. */
.skip-link {
  display: block;
  width: auto;
  margin: 11px auto 0;
  padding: 4px 8px;
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: .76rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color .18s var(--ease);
}
.skip-link:hover { color: var(--ink-soft); }

/* Button spinner (contact submit) */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}
.btn.is-loading .btn-label { opacity: .7; }
.btn.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------- Progress ------------------------- */
.progress-wrap { margin: 4px 2px 18px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 9px;
}
.progress-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.progress-pct { font-size: .78rem; font-weight: 700; color: var(--gold-deep); }
.progress-track {
  height: 6px;
  background: var(--paper-2);
  border-radius: 100px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-fill {
  height: 100%;
  width: 14%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-deep) 100%);
  border-radius: 100px;
  transition: width .5s var(--ease);
}

/* ------------------------- Quiz ------------------------- */
.card-quiz { padding: clamp(22px, 4.5vw, 36px); }
.q-index {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 12px;
}
.q-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 4.4vw, 1.72rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.q-sub {
  font-size: .95rem;
  color: var(--ink-soft);
  margin: 0 0 22px;
}
.q-sub:empty { display: none; margin: 0; }

.options { display: grid; gap: 11px; margin-top: 20px; }
.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .12s var(--ease), box-shadow .16s var(--ease);
}
.option:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -18px rgba(13,37,64,.6);
}
.option .marker {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  transition: border-color .16s var(--ease), background .16s var(--ease);
  position: relative;
}
.option:hover .marker { border-color: var(--ink); }
.option.is-selected {
  border-color: var(--ink);
  background: var(--gold-tint);
}
.option.is-selected .marker { border-color: var(--gold-deep); background: var(--gold-deep); }
.option.is-selected .marker::after {
  content: "";
  position: absolute;
  left: 5px; top: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
}

.quiz-nav { display: flex; justify-content: flex-start; padding: 14px 4px 0; min-height: 20px; }
.quiz-nav.is-hidden { visibility: hidden; }

/* ------------------------- Contact ------------------------- */
.card-contact { }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  padding: 14px 15px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: var(--radius-sm);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.field input::placeholder { color: #a9b2bd; }
.field input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(176,138,69,.16);
}
.field input.has-error { border-color: var(--rust); }
.field-error {
  margin: 7px 0 0;
  font-size: .8rem;
  color: var(--rust);
  font-weight: 500;
}

/* ------------------------- Result ------------------------- */
.card-result { text-align: center; overflow: hidden; }
.result-head {
  margin: -8px -8px 6px;
  padding: 6px 8px 20px;
}
.result-hello {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px;
}
.score-dial {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 168px; height: 168px;
  border-radius: 50%;
  margin: 4px auto 16px;
  background: radial-gradient(circle at 50% 38%, #fff 0%, var(--paper) 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 2px 10px rgba(13,37,64,.05);
  position: relative;
}
.score-dial::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(var(--band-color, var(--gold)) calc(var(--score-turn, 0) * 1turn), var(--paper-2) 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  transition: background .9s var(--ease);
}
.score-number {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 3.4rem;
  line-height: 1;
  color: var(--ink);
}
.score-outof {
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.band-badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.result-body { padding: 6px 0 4px; }
.result-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 4.5vw, 1.7rem);
  line-height: 1.18;
  margin: 14px 0 12px;
  color: var(--ink);
}
.result-message, .result-gap, .result-close {
  font-size: 1.02rem;
  color: var(--ink-soft);
  margin: 0 auto 12px;
  max-width: 44ch;
}
.result-gap {
  background: var(--gold-tint);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  color: var(--ink);
  font-weight: 500;
}
.result-close { font-weight: 500; color: var(--ink); }

/* ------------------------- Per-area breakdown ------------------------- */
.result-breakdown {
  text-align: left;
  margin: 22px auto 4px;
  max-width: 440px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.breakdown-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.12rem;
  color: var(--ink);
  margin: 0 0 4px;
}
.breakdown-hint {
  font-size: .86rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.breakdown-list { display: grid; gap: 2px; }
.breakdown-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.breakdown-row:last-child { border-bottom: 0; }
.breakdown-marker {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  position: relative;
}
/* Strong = green circle with a white check */
.breakdown-row.is-strong .breakdown-marker { background: var(--green-tint); }
.breakdown-row.is-strong .breakdown-marker::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 5px;
  height: 10px;
  border: solid var(--green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
/* Needs-work = amber ring with a filled amber dot */
.breakdown-row.is-weak .breakdown-marker { background: var(--amber-tint); }
.breakdown-row.is-weak .breakdown-marker::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
}
.breakdown-body { min-width: 0; }
.breakdown-area {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 600;
  font-size: .96rem;
  color: var(--ink);
  line-height: 1.3;
}
.breakdown-tag {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
}
.breakdown-row.is-strong .breakdown-tag { background: var(--green-tint); color: var(--green); }
.breakdown-row.is-weak .breakdown-tag { background: var(--amber-tint); color: var(--amber); }
.breakdown-note {
  display: block;
  margin-top: 3px;
  font-size: .9rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

.result-cta {
  display: grid;
  gap: 11px;
  margin: 24px auto 0;
  max-width: 380px;
}
.result-fineprint {
  margin: 16px 0 0;
  font-size: .82rem;
  color: var(--muted);
}

/* Band theming on the result card */
.card-result.band-green  { --band-color: var(--green); }
.card-result.band-yellow { --band-color: var(--amber); }
.card-result.band-red    { --band-color: var(--rust); }

.card-result.band-green  .band-badge { background: var(--green-tint); color: var(--green); }
.card-result.band-yellow .band-badge { background: var(--amber-tint); color: var(--amber); }
.card-result.band-red    .band-badge { background: var(--rust-tint);  color: var(--rust); }

/* Focus visibility for keyboard users */
:focus-visible { outline: 3px solid rgba(176,138,69,.5); outline-offset: 2px; border-radius: 6px; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ------------------------- Small screens ------------------------- */
@media (max-width: 480px) {
  .brand-tag { display: none; }
  .header-inner { padding: 13px 18px; }
  .brand-logo { height: 34px; }
  .score-dial { width: 148px; height: 148px; }
  .score-number { font-size: 3rem; }
  .result-breakdown { padding-top: 18px; }
}
