/* Second Chance Mortgage Leads — matches the Agent Autopilot design system */
:root{
  --ink:#0b1220;
  --muted:#5b6678;
  --line:#e6ebf3;
  --bg:#ffffff;
  --soft:#f4f7fd;
  --navy:#12245e;
  --navy-deep:#0b1733;
  --brand:#1d4ed8;
  --brand-bright:#2563eb;
  --cyan-bright:#38bdf8;
  --gold:#f4b740;
  --gold-ink:#3a2c00;
  --ok:#0f9d58;
  --bad:#d23b3b;
  --radius:14px;
  --radius-lg:18px;
  --shadow-sm:0 8px 26px rgba(16,32,70,.06);
  --shadow-md:0 18px 44px rgba(16,32,70,.10);
  --maxw:1120px;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);background:var(--soft);line-height:1.6;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
a{color:var(--brand);text-decoration:none}
h1,h2,h3{letter-spacing:-.4px;line-height:1.16}
.wrap{max-width:var(--maxw);margin:0 auto;padding:0 22px}

/* Header */
header.nav{background:var(--navy-deep);border-bottom:1px solid rgba(127,208,255,.10)}
header.nav .wrap{display:flex;align-items:center;justify-content:space-between;padding:16px 22px;gap:16px}
.logo{display:flex;align-items:center;gap:9px;font-weight:800;font-size:17px;color:#fff;letter-spacing:.2px}
.logo .dot{width:26px;height:26px;border-radius:8px;background:linear-gradient(135deg,var(--cyan-bright),var(--brand));display:inline-flex;flex:0 0 auto}
.header-trust{color:#9fb0cf;font-size:13.5px;font-weight:600}

/* Hero */
.hero{background:radial-gradient(1200px 520px at 78% -12%,#1d4ed8 0%,#12245e 52%,#0b1733 100%);color:#fff;padding:52px 0 60px}
.hero .eyebrow{display:inline-block;font-size:12.5px;font-weight:700;letter-spacing:1.3px;text-transform:uppercase;color:#9fd2ff;background:rgba(127,208,255,.12);border:1px solid rgba(127,208,255,.28);padding:6px 13px;border-radius:999px;margin-bottom:16px}
.hero h1{font-size:clamp(28px,4vw,40px);font-weight:840;letter-spacing:-.6px}
.hero-sub{margin-top:14px;font-size:17px;color:#d6e2f7;max-width:620px}

/* Layout */
.builder-layout{padding-top:36px;padding-bottom:72px;display:grid;gap:24px}

/* Category cards */
.category-list{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}
.category-list .category-row.is-open-row{grid-column:1 / -1;max-width:none;justify-self:stretch}
.category-row{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);overflow:hidden;
  transition:box-shadow .12s ease,border-color .12s ease;
}
.category-row:hover{box-shadow:var(--shadow-md);border-color:#cdd8ec}

.category-toggle{
  width:100%;background:none;border:none;cursor:pointer;text-align:left;
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  padding:20px 22px;font:inherit;
}
.category-toggle:focus-visible{outline:none;box-shadow:inset 0 0 0 3px rgba(29,78,216,.14)}
.category-info{display:flex;flex-direction:column;gap:5px}
.category-title{font-weight:750;font-size:17px;color:var(--ink)}
.category-meta{color:var(--brand);font-weight:700;font-size:15px}
.category-note{color:#a8720e;font-size:13px}
.category-chevron{color:var(--muted);font-size:14px;transition:transform .15s ease;flex:0 0 auto}
.category-toggle.is-open .category-chevron{transform:rotate(180deg)}

.category-body{
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
  padding:0 22px 20px;border-top:1px solid var(--line);padding-top:16px;
}
.qty-label{font-size:12px;color:var(--muted);font-weight:700;letter-spacing:.3px;text-transform:uppercase}
.qty-input{
  width:112px;min-height:46px;padding:8px 12px;
  border:1.5px solid var(--line);border-radius:10px;font-size:15px;font-family:inherit;
  transition:border-color .12s ease,box-shadow .12s ease;
}
.qty-input:focus-visible{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(29,78,216,.14)}
.category-line-total{font-weight:700;font-size:14px;color:var(--ok)}
.category-error{font-weight:600;font-size:13px;color:var(--bad)}
.category-inventory{flex-basis:100%;font-size:13px;color:var(--muted);padding-top:4px;border-top:1px dashed var(--line);margin-top:2px}
.category-inventory strong{color:var(--ink)}
.category-totals{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.category-totals strong{color:var(--ink)}

.category-body{align-items:flex-start}
.category-states-field,.category-notes-field{flex-basis:100%;margin-top:4px}
.category-states-field .field-label,.category-notes-field label{font-size:13px;margin-bottom:6px}
.optional-tag{font-weight:400;color:var(--muted);text-transform:none;letter-spacing:0}
.notes-input{
  width:100%;min-height:64px;padding:10px 13px;resize:vertical;
  border:1.5px solid var(--line);border-radius:10px;font-size:14px;font-family:inherit;
  color:var(--ink);transition:border-color .12s ease,box-shadow .12s ease;
}
.notes-input:focus-visible{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(29,78,216,.14)}

.add-to-cart-button{
  flex-basis:100%;min-height:46px;background:var(--brand);color:#fff;
  border:none;border-radius:10px;font-size:14.5px;font-weight:750;cursor:pointer;
  padding:10px 16px;margin-top:6px;transition:background .12s ease,transform .08s ease;
}
.add-to-cart-button:hover{background:var(--brand-bright)}
.add-to-cart-button:active{transform:translateY(1px)}
.add-to-cart-note{flex-basis:100%;color:var(--ok);font-weight:650;font-size:13px}

.cart-line-states{color:var(--muted);font-size:12.5px}
.cart-line-notes{color:var(--muted);font-size:12.5px;font-style:italic}

/* Cart panel */
.cart-panel{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);padding:26px;max-width:520px;margin:0 auto;
}
.cart-panel h2{margin:0 0 16px;font-size:19px;font-weight:800;color:var(--ink)}
.cart-panel h3{margin:26px 0 16px;font-size:15px;font-weight:750;padding-top:22px;border-top:1px solid var(--line);color:var(--ink)}

.cart-lines{list-style:none;display:flex;flex-direction:column;gap:12px}
.cart-empty{color:var(--muted);font-size:14px}
.cart-line{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.cart-line-info{display:flex;flex-direction:column;gap:2px}
.cart-line-title{font-weight:700;font-size:14.5px;color:var(--ink)}
.cart-line-meta{color:var(--muted);font-size:13px}
.cart-line-actions{display:flex;align-items:center;gap:10px}
.cart-line-total{font-weight:750;font-size:14.5px;white-space:nowrap;color:var(--ink)}

.remove-button{
  width:24px;height:24px;min-height:24px;border-radius:50%;
  border:1px solid var(--line);background:var(--soft);color:var(--muted);
  font-size:15px;line-height:1;cursor:pointer;padding:0;
}
.remove-button:hover{border-color:var(--bad);color:var(--bad)}

.cart-totals{margin-top:16px}
.cart-total-row{display:flex;align-items:baseline;justify-content:space-between;font-size:17px;font-weight:700;padding-top:14px}
#cart-total{color:var(--ok);transition:color .12s ease}
#cart-total.under-minimum{color:var(--bad)}
.min-order-note{margin-top:8px;font-weight:650;color:var(--ok);font-size:13.5px;min-height:1.2em}
.min-order-note.warning{color:var(--bad)}

.hidden{display:none !important}

/* Form fields */
.field{margin-bottom:16px}
.field label{display:block;font-weight:700;margin-bottom:7px;font-size:13.5px;color:var(--ink)}
.field input,.field select{
  width:100%;min-height:46px;padding:10px 13px;
  border:1.5px solid var(--line);border-radius:10px;font-size:15px;font-family:inherit;
  transition:border-color .12s ease,box-shadow .12s ease;background:#fff;color:var(--ink);
}
.field input:focus-visible,.field select:focus-visible{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(29,78,216,.14)}

.field-label{display:block;font-weight:700;margin-bottom:7px;font-size:13.5px;color:var(--ink)}
.states-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:4px 8px;
  padding:12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;
}
.state-checkbox{
  display:flex;align-items:center;gap:5px;font-weight:400;font-size:12.5px;
  color:var(--ink);padding:5px 6px;cursor:pointer;border-radius:6px;
}
.state-checkbox:hover{background:var(--soft)}
.state-checkbox input[type="checkbox"]{width:15px;height:15px;min-width:15px;cursor:pointer;flex:0 0 auto}
.state-name{flex:1;min-width:0}
.state-count{flex:0 0 auto;font-size:10.5px;font-weight:600;color:var(--muted);padding:1px 5px;border-radius:8px;background:var(--soft)}
.state-count:empty{display:none}

.checkbox-field{display:flex;align-items:flex-start;gap:10px}
.checkbox-field input[type="checkbox"]{width:20px;height:20px;min-width:20px;margin-top:2px}
.checkbox-field label{font-weight:400;font-size:13.5px}
.checkbox-field a{color:var(--brand);font-weight:600}

.form-error{color:var(--bad);font-weight:650;font-size:13.5px}

.cta-button{
  width:100%;min-height:52px;background:var(--brand);color:#fff;
  border:none;border-radius:11px;font-size:16px;font-weight:800;cursor:pointer;
  box-shadow:0 10px 24px rgba(29,78,216,.28);
  transition:background .12s ease,transform .08s ease,filter .12s ease;
}
.cta-button:hover:not(:disabled){background:var(--brand-bright)}
.cta-button:active:not(:disabled){transform:translateY(1px)}
.cta-button:disabled{background:#cbd5e1;box-shadow:none;cursor:not-allowed}
.cta-button:focus-visible{outline:3px solid #7fd0ff;outline-offset:2px}

.trust-line{text-align:center;color:var(--muted);font-size:12.5px;margin-top:12px}

/* Footer */
footer.site{background:var(--navy-deep);color:#9fb0cf;padding:36px 0;font-size:14px}
footer.site .wrap{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:14px}
footer.site nav{display:flex;gap:20px;flex-wrap:wrap}
footer.site nav a{color:#9fb0cf}
footer.site nav a:hover{color:#fff}
footer.site .footer-note{color:#6f7e9c;font-size:13px}

/* Contact strip */
.contact-strip{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);padding:20px 24px;margin-top:24px;
  display:flex;flex-wrap:wrap;gap:20px;align-items:center;justify-content:center;
  text-align:center;font-size:14.5px;color:var(--muted);
}
.contact-strip a{color:var(--brand);font-weight:700}

/* Success / order summary */
.confirm-hero{background:radial-gradient(1200px 520px at 78% -12%,#1d4ed8 0%,#12245e 52%,#0b1733 100%);color:#fff;padding:52px 0 64px;text-align:center}
.confirm-hero .check{
  width:58px;height:58px;border-radius:50%;background:rgba(94,233,164,.16);
  border:1.5px solid rgba(94,233,164,.4);display:flex;align-items:center;justify-content:center;
  margin:0 auto 18px;color:#5ee9a4;font-size:28px;font-weight:800;
}
.confirm-hero h1{font-size:clamp(24px,3.6vw,32px);font-weight:840}
.confirm-hero p{margin-top:10px;color:#d6e2f7;font-size:16px}

.order-summary{
  background:#fff;border:1px solid var(--line);border-radius:var(--radius-lg);
  box-shadow:var(--shadow-md);padding:28px;margin-top:-36px;position:relative;z-index:1;
}
.order-summary h3{font-size:16px;font-weight:800;margin-bottom:16px;color:var(--ink)}
.order-summary dl{display:grid;grid-template-columns:1fr auto;gap:10px 16px;margin:0}
.order-summary dt{color:var(--muted);font-size:14.5px}
.order-summary dd{margin:0;font-weight:700;text-align:right;font-size:14.5px}
.order-summary hr{border:none;border-top:1px solid var(--line);margin:16px 0}

.receipt-link{display:inline-block;margin-top:16px;font-weight:700}
.confirm-note{color:var(--muted);font-size:14.5px;margin-top:16px}

.category-modal-bar{display:none}

/* Responsive */
@media(max-width:1024px){
  .category-list{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:640px){
  .category-list{grid-template-columns:1fr}
  .category-body{justify-content:space-between}
  .qty-label{flex-basis:100%}
  .qty-input{flex:1;font-size:16px;min-height:50px}
  footer.site .wrap{flex-direction:column;align-items:flex-start;text-align:left}

  body.modal-open{overflow:hidden}
  .category-body.is-modal{
    position:fixed;inset:0;z-index:1000;background:#fff;
    margin:0;border:none;border-radius:0;overflow-y:auto;
    padding:14px 18px 28px;
  }
  .category-modal-bar{
    display:flex;align-items:center;justify-content:space-between;flex-basis:100%;
    margin:-14px -18px 14px;padding:14px 18px;border-bottom:1px solid var(--line);
    position:sticky;top:-14px;background:#fff;z-index:1;
  }
  .category-modal-title{font-weight:800;font-size:16px;color:var(--ink)}
  .category-modal-close{
    width:40px;height:40px;min-height:40px;border-radius:50%;
    border:1px solid var(--line);background:var(--soft);font-size:22px;line-height:1;
    cursor:pointer;color:var(--muted);padding:0;
  }

  /* Fewer, wider state tiles so names/counts never collide, and taps land cleanly. */
  .states-grid{grid-template-columns:repeat(2,1fr);gap:2px 8px;max-height:none}
  .state-checkbox{font-size:14px;padding:9px 6px;min-height:38px}
  .state-count{font-size:11px}

  .notes-input{font-size:16px}
  .add-to-cart-button{min-height:52px;font-size:16px}
  .qty-input,.notes-input{scroll-margin-top:80px}
}
