/* =====================================================================
   Selective Capital — merchant portal theme
   Brand gradient pulled straight from the logo S-mark:
   blue #2E7BFF → violet #A855F7 → magenta #D946EF on white.
   Premium, clean, mobile-first. Shared by application.html + upload.html.
   ===================================================================== */
:root {
  --sc-blue:    #2E7BFF;
  --sc-violet:  #A855F7;
  --sc-magenta: #D946EF;
  --sc-gradient: linear-gradient(135deg, #2E7BFF 0%, #A855F7 52%, #D946EF 100%);

  --sc-ink:     #0B0B14;   /* near-black, matches logo */
  --sc-text:    #14141d;
  --sc-muted:   #5c5c72;
  --sc-line:    #e8e8f1;
  --sc-bg:      #f6f6fb;
  --sc-card:    #ffffff;
  --sc-surface: #faf8ff;   /* faint violet tint */

  --sc-error:   #dc2626;
  --sc-success: #059669;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow-soft: 0 1px 2px rgba(11,11,20,.04), 0 10px 34px rgba(46,123,255,.08);
  --shadow-pop:  0 14px 44px rgba(168,85,247,.20);

  --font-display: "Montserrat", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans:    "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--sc-bg);
  color: var(--sc-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
  /* faint brand glow behind the page */
  background-image:
    radial-gradient(46% 40% at 12% 0%,  rgba(46,123,255,.10), transparent 60%),
    radial-gradient(46% 44% at 100% 8%, rgba(217,70,239,.08), transparent 62%);
  background-attachment: fixed;
}

/* Brand wordmark feel — thin, wide-tracked, uppercase */
.wordmark {
  font-family: var(--font-display);
  font-weight: 300;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.text-gradient {
  background: var(--sc-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Top bar ---------- */
.topbar {
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--sc-line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--sc-gradient);
}
.topbar .wrap {
  max-width: 760px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 14px;
}
.topbar .logo { height: 30px; width: auto; display: block; }
.topbar .brand-tag {
  margin-left: auto; font-size: 11px; color: var(--sc-muted);
  letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
}

/* ---------- Container & card ---------- */
.container { max-width: 760px; margin: 28px auto 120px; padding: 0 20px; }
.card {
  background: var(--sc-card);
  border: 1px solid var(--sc-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 26px 26px 30px;
  position: relative; overflow: hidden;
}

/* ---------- Headings ---------- */
h1 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 6vw, 2rem);
  font-weight: 700; letter-spacing: -.01em;
  margin: 0 0 6px; line-height: 1.1;
}
.lead { color: var(--sc-muted); margin: 0 0 22px; font-size: 15px; line-height: 1.6; }

/* ---------- Rep banner ---------- */
.rep-banner {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, rgba(46,123,255,.10), rgba(217,70,239,.10));
  color: #7c3aed; border: 1px solid rgba(168,85,247,.25);
  padding: 6px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.rep-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc-gradient); }

/* ---------- Progress stepper (application.html) ---------- */
.stepper {
  display: flex; align-items: flex-start; gap: 4px;
  margin: 4px 0 22px; padding-bottom: 4px;
}
.stepper .s-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 6px; position: relative; min-width: 0;
}
.stepper .s-item::before {     /* connector line to previous step */
  content: ""; position: absolute; top: 15px; right: 50%; left: -50%;
  height: 2px; background: var(--sc-line); z-index: 0;
}
.stepper .s-item:first-child::before { display: none; }
.stepper .s-item.is-done::before,
.stepper .s-item.is-active::before { background: var(--sc-gradient); }
.stepper .s-num {
  position: relative; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: #fff; color: var(--sc-muted);
  border: 2px solid var(--sc-line); transition: all .2s ease;
}
.stepper .s-item.is-active .s-num {
  background: var(--sc-gradient); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(168,85,247,.35);
}
.stepper .s-item.is-done .s-num {
  background: var(--sc-ink); color: #fff; border-color: var(--sc-ink);
}
.stepper .s-label {
  font-size: 11px; color: var(--sc-muted); font-weight: 600;
  text-align: center; line-height: 1.2; letter-spacing: .01em;
}
.stepper .s-item.is-active .s-label { color: var(--sc-text); }
@media (max-width: 560px) {
  .stepper .s-label { display: none; }       /* keep just the numbered dots on small phones */
  .stepper .s-item::before { top: 15px; }
}

/* ---------- Step panels ---------- */
.step-panel { display: none; animation: stepIn .35s cubic-bezier(.16,1,.3,1); }
.step-panel.is-active { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.step-panel h2 {
  font-size: 17px; margin: 0 0 4px; font-weight: 700; letter-spacing: .01em;
}
.step-panel .step-sub { color: var(--sc-muted); font-size: 13.5px; margin: 0 0 16px; }
@media (prefers-reduced-motion: reduce) { .step-panel { animation: none; } }

/* ---------- Sections (upload.html long form) ---------- */
.section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--sc-line); }
.section:first-of-type { margin-top: 2px; padding-top: 0; border-top: 0; }
.section h2 { font-size: 16px; margin: 0 0 14px; font-weight: 700; letter-spacing: .01em; }

/* ---------- Form grid + inputs ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

label { display: block; font-size: 13px; color: var(--sc-text); font-weight: 600; margin-bottom: 6px; }
label .req { color: var(--sc-magenta); margin-left: 2px; }

input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], select, textarea {
  width: 100%;
  min-height: 48px;                 /* touch-friendly */
  padding: 12px 14px;
  font: inherit; font-size: 16px;   /* 16px avoids iOS zoom-on-focus */
  color: var(--sc-text); background: #fff;
  border: 1px solid var(--sc-line); border-radius: var(--radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235c5c72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
input:focus, select:focus, textarea:focus {
  border-color: var(--sc-violet);
  box-shadow: 0 0 0 4px rgba(168,85,247,.14);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.hint { font-size: 12.5px; color: var(--sc-muted); margin-top: 5px; }

/* ---------- File drop zones ---------- */
.dropzone {
  position: relative;
  border: 1.5px dashed #c9c9da; border-radius: var(--radius-sm);
  padding: 22px 18px; text-align: center; background: var(--sc-surface);
  cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s;
}
.dropzone:hover, .dropzone.drag {
  background: #fff; border-color: var(--sc-violet);
  box-shadow: 0 0 0 4px rgba(168,85,247,.10);
  background-image: linear-gradient(135deg, rgba(46,123,255,.05), rgba(217,70,239,.05));
}
.dropzone .label-line { font-weight: 600; color: var(--sc-text); margin-bottom: 4px; }
.dropzone .small { color: var(--sc-muted); font-size: 12.5px; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* ---------- File list ---------- */
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list li {
  display: flex; align-items: center; gap: 10px;
  background: var(--sc-surface); border: 1px solid var(--sc-line);
  border-radius: 10px; padding: 9px 12px; font-size: 13.5px;
}
.file-list li > span:first-child { font-weight: 600; color: var(--sc-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li .x {
  margin-left: auto; flex: 0 0 auto; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--sc-muted); font-size: 18px; line-height: 1;
  background: #fff; border: 1px solid var(--sc-line); transition: all .15s;
}
.file-list li .x:hover { color: var(--sc-error); border-color: var(--sc-error); }

/* ---------- Consent ---------- */
.consent {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 22px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--sc-surface); border: 1px solid var(--sc-line);
}
.consent input[type=checkbox] {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  accent-color: var(--sc-violet); cursor: pointer;
}
.consent .text { font-size: 12.5px; color: var(--sc-muted); line-height: 1.6; font-weight: 400; }

/* ---------- Buttons ---------- */
.btn, .primary {
  font: inherit; font-weight: 600; font-size: 15px;
  min-height: 52px; padding: 0 26px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; cursor: pointer; border: 0;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s;
}
.btn:active, .primary:active { transform: translateY(1px); }
.btn[disabled], .primary[disabled] { opacity: .55; cursor: not-allowed; }

.primary, .btn-primary {
  position: relative; color: #fff; background: var(--sc-gradient);
  box-shadow: 0 8px 22px rgba(168,85,247,.30);
}
.primary:hover, .btn-primary:hover { box-shadow: var(--shadow-pop); }

.btn-ghost {
  background: #fff; color: var(--sc-text); border: 1px solid var(--sc-line);
}
.btn-ghost:hover { border-color: var(--sc-violet); color: var(--sc-violet); }

/* single-page (upload.html) submit row */
.actions { margin-top: 24px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Sticky step nav bar (application.html) ---------- */
.step-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-top: 1px solid var(--sc-line);
  padding: 12px 20px; padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.step-nav .wrap {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
}
.step-nav .meta { font-size: 13px; color: var(--sc-muted); font-weight: 600; margin-right: auto; }
.step-nav .btn { min-height: 48px; flex: 0 0 auto; }
@media (max-width: 560px) {
  .step-nav .meta { display: none; }
  .step-nav .wrap { gap: 10px; }
  .step-nav .btn { flex: 1; }
}

/* ---------- Review step ---------- */
.review-group { margin-bottom: 16px; border: 1px solid var(--sc-line); border-radius: var(--radius-sm); overflow: hidden; }
.review-group .rg-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--sc-surface); padding: 11px 14px; border-bottom: 1px solid var(--sc-line);
}
.review-group .rg-head h3 { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--sc-muted); }
.review-group .edit-link {
  font-size: 13px; font-weight: 600; color: var(--sc-violet);
  background: none; border: 0; cursor: pointer; padding: 4px 6px; min-height: auto;
}
.review-row { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #f1f1f8; font-size: 14px; }
.review-row:last-child { border-bottom: 0; }
.review-row .rk { color: var(--sc-muted); flex: 0 0 42%; }
.review-row .rv { color: var(--sc-text); font-weight: 600; word-break: break-word; }

/* ---------- Banner / status ---------- */
.banner { display: none; margin-top: 16px; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; }
.banner.show { display: block; }
.banner.error   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.banner.success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ---------- Footer ---------- */
.foot { text-align: center; color: var(--sc-muted); font-size: 12.5px; margin: 22px 0 0; }
.foot a { color: var(--sc-violet); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- Accessibility ---------- */
:focus-visible { outline: 2px solid var(--sc-violet); outline-offset: 2px; border-radius: 8px; }

@media (max-width: 600px) {
  .card { padding: 22px 18px 26px; border-radius: 16px; }
  .container { margin: 18px auto 120px; padding: 0 14px; }
}

/* =====================================================================
   AI Soft Offer — analyzing state, offer card, manual-review notice
   ===================================================================== */
.offer-stage { min-height: 300px; }

/* Analyzing */
.analyzing { text-align: center; padding: 18px 6px; animation: stepIn .35s cubic-bezier(.16,1,.3,1); }
.analyzing .ring { width: 96px; height: 96px; margin: 0 auto 18px; }
.analyzing .ring svg { transform: rotate(-90deg); display: block; }
.analyzing .ring .track { stroke: var(--sc-line); }
.analyzing .ring .fill { stroke: url(#scgrad); stroke-linecap: round; transition: stroke-dashoffset .45s ease; }
.analyzing h2 { margin: 0 0 4px; font-size: 19px; }
.analyzing .sub { color: var(--sc-muted); font-size: 14px; margin: 0; }
.analyzing .checks { list-style: none; padding: 0; margin: 18px auto 0; max-width: 300px; text-align: left; display: grid; gap: 9px; }
.analyzing .checks li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--sc-muted); opacity: .4; transition: opacity .3s, color .3s; }
.analyzing .checks li.on { opacity: 1; color: var(--sc-text); }
.analyzing .checks li .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--sc-line); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 11px; color: transparent; }
.analyzing .checks li.done .dot { background: var(--sc-gradient); border-color: transparent; color: #fff; }

/* Offer card */
.offer-card { border: 1px solid var(--sc-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); animation: offerIn .55s cubic-bezier(.16,1,.3,1); }
@keyframes offerIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.offer-card .head { background: var(--sc-gradient); color: #fff; padding: 20px; }
.offer-card .head .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; opacity: .92; font-weight: 600; }
.offer-card .head .amount { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem,9vw,2.6rem); line-height: 1.04; margin-top: 4px; font-variant-numeric: tabular-nums; }
.offer-card .head .caption { font-size: 12px; opacity: .95; margin-top: 8px; }
.offer-card .tiles { display: grid; grid-template-columns: repeat(3,1fr); background: #fff; }
.offer-card .tile { padding: 14px 10px; text-align: center; border-right: 1px solid var(--sc-line); }
.offer-card .tile:last-child { border-right: 0; }
.offer-card .tk { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sc-muted); }
.offer-card .tv { font-family: var(--font-display); font-weight: 700; font-size: 17px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.offer-inline-cap { text-align: center; font-size: 12px; color: var(--sc-muted); margin-top: 12px; }
.offer-disclaimer { font-size: 11.5px; color: var(--sc-muted); line-height: 1.55; margin-top: 12px; padding: 12px 14px; background: var(--sc-surface); border: 1px solid var(--sc-line); border-radius: 10px; }
.calc-toggle { background: none; border: 0; color: var(--sc-violet); font-weight: 600; font-size: 13px; cursor: pointer; margin: 12px auto 0; display: block; min-height: 36px; }
.calc-sheet { margin-top: 6px; font-size: 13px; color: var(--sc-text); }
.calc-sheet .row { display: flex; justify-content: space-between; border-bottom: 1px solid #f1f1f8; padding: 7px 0; }
.calc-sheet .row:last-child { border-bottom: 0; }
.calc-sheet .row .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Manual-review notice */
.manual-card { border: 1px solid var(--sc-line); border-radius: var(--radius); padding: 24px 22px; text-align: center; box-shadow: var(--shadow-soft); animation: offerIn .5s cubic-bezier(.16,1,.3,1); }
.manual-card .badge { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--sc-surface); border: 1px solid var(--sc-line); color: var(--sc-violet); }
.manual-card h2 { font-size: 19px; margin: 0 0 6px; }
.manual-card p { color: var(--sc-muted); font-size: 14px; line-height: 1.6; margin: 0 auto; max-width: 360px; }
