/*
 * Ported verbatim from Docs/prototype.html's <style> block. Every rule below
 * is unchanged from the prototype — including the dev-only rules
 * (.dev-key-btn, .places-status, .apikey-modal, .apikey-row, .apikey-hint,
 * .demo-otp-banner) whose markup is not ported into the production
 * templates (requirements.md §49, §55). This comment header is the only
 * addition.
 */
:root{
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --ink: #16233E;
  --ink-soft: #57617A;
  --ink-faint: #8B93A6;
  --brass: #8A6D24;
  --brass-light: #E0C27E;
  --brass-bg: #FBF3E1;
  --brass-line: #E3CD98;
  --line: #B7BDC9;
  --line-soft: #D7DBE3;
  --success: #206C4C;
  --success-bg: #E7F3EC;
  --error: #A6342A;
  --error-bg: #FBEAE8;
  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(22,35,62,0.06), 0 8px 24px rgba(22,35,62,0.06);
}

*{ box-sizing: border-box; }
html,body{ height:auto; min-height:100%; }
body{
  margin:0;
  background: var(--bg);
  background-image: radial-gradient(circle at 15% 0%, #EAEDF3 0%, var(--bg) 45%);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 28px 16px 60px;
}

@media (min-width: 768px) {
  body {
    background-color: #ECEFF4;
    background-image:
      radial-gradient(circle at 50% 20%, rgba(224, 194, 126, 0.15) 0%, transparent 60%),
      radial-gradient(circle at 50% 50%, #E2E7F0 0%, #D8DFEC 100%);
  }
}

.logo-header{
  display:grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items:center;
  gap: 16px;
  background: var(--ink);
  padding: 13px 22px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.logo-header .tl-block{
  display:flex;
  align-items:center;
  min-width: 0;
}
.logo-header .th-logo-mark{
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.logo-header .powered-by{
  font-size: 0.8rem;
  color: #AEB8CC;
  text-align: right;
  white-space: nowrap;
  line-height: 1.5;
}
.logo-header .powered-by strong{
  color: #E5EAF3;
  font-weight: 1000;
}
@media (max-width: 390px) {
  .logo-header{
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .logo-header .powered-by{
    justify-self: end;
  }
}

.dev-key-btn{
  display:flex; align-items:center; gap:6px;
  margin-bottom: 10px;
  padding: 5px 12px;
  background: #FFF9E8;
  border: 1px dashed var(--brass-line);
  border-radius: 20px;
  font-size: 0.72rem; font-weight:600; color: var(--ink-soft);
  cursor: pointer;
}
.dev-key-btn:hover{ border-color: var(--brass); }
.places-status{
  font-size: 0.64rem; font-weight:700;
  padding: 2px 7px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.places-status.mock{ background: var(--line-soft); color: var(--ink-faint); }
.places-status.live{ background: var(--success-bg); color: var(--success); }
.apikey-modal .modal{ height: auto; max-width: 380px; }
.apikey-modal .modal-body{ padding: 18px 16px; }
.apikey-row{ display:flex; gap:8px; margin-bottom: 10px; }
.apikey-row input{
  flex:1; min-width:0;
  padding: 9px 10px;
  font-size: 0.85rem;
  font-family: 'SFMono-Regular', Consolas, monospace;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.apikey-row button{
  padding: 9px 18px;
  font-size: 0.85rem; font-weight:600;
  border:none; border-radius: var(--radius-sm);
  background: var(--ink); color:#fff; cursor:pointer;
}
.apikey-hint{
  font-size: 0.72rem; color: var(--ink-faint);
  line-height:1.4;
}

.card{
  width:100%;
  max-width: 480px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-body{
  padding: 26px 26px;
}

/* ---------- Step tracker ---------- */
.step{ min-height: 430px; }
.tracker{
  display:flex;
  align-items:center;
  margin-bottom: 26px;
}
.tracker .node{
  display:flex;
  flex-direction:column;
  align-items:center;
  flex: 0 0 auto;
}
.tracker .dot{
  width: 26px; height: 26px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1.5px solid var(--line);
  color: var(--ink-faint);
  background: var(--surface);
  transition: all 0.25s ease;
}
.tracker .label{
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 6px;
  max-width: 130px;
  white-space: nowrap;
  text-align:center;
  line-height:1.2;
}
.tracker .connector{
  flex: 1 1 auto;
  height: 1.5px;
  background: var(--line);
  margin: 0 4px;
  position: relative;
  top: -13px;
}
.tracker .node.done .dot{
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.tracker .node.done .label{ color: var(--ink-soft); }
.tracker .node.current .dot{
  border-color: var(--brass);
  color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-bg);
}
.tracker .node.current .label{ color: var(--ink); font-weight: 600; }
.tracker .connector.done{ background: var(--ink); }

/* ---------- Typography ---------- */
h1.step-title{
  font-family:'Newsreader', serif;
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 6px;
  color: var(--ink);
}
#step-orders .step-title{ margin-bottom: 20px; }
h1.step-title .reg-mark{
  font-family: inherit;
  font-weight: 400;
  line-height: 0;
  vertical-align: baseline;
  font-size: 0.75em;        /* SIZE: bigger number = bigger ® */
  position: relative;
  top: -0.25em;             /* HEIGHT: more negative = higher, less negative = lower */
  margin-left: -0.05em;     /* GAP: negative = closer to "Hunter", positive = farther */
}
p.step-sub{
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 22px;
  line-height: 1.5;
}

/* ---------- Form elements ---------- */
label{
  display:block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
label .optional{
  font-weight: 400;
  color: var(--ink-faint);
}
.field{ margin-bottom: 16px; }
.field-row{ display:flex; gap:12px; margin-bottom: 16px; }
.field-row .field{ flex:1; min-width:0; margin-bottom:0; }
.field-row .field-third{ flex: 1 1 0; }
.field-row .field-quarter{ flex: 1 1 0; min-width:0; }
.field-row .field-narrow{ flex: 0.8 1 0; min-width:0; }
.field-row .field-stnum{ flex: 0.6 1 0; min-width:0; }
.field-row .field-unit{ flex: 0.4 1 0; min-width:0; }
.field-row .field-tiny{ flex: 0.45 1 0; min-width:0; }
.field-row .field-grow{ flex: 1.5 1 0; min-width:0; }
.field-row.dense{ gap: 6px; }
.compact-input{ padding: 7px 6px !important; text-align:center; }
#addr-name.compact-input, #addr-city.compact-input, #addr-county.compact-input{ text-align:left; }
select#addr-state.compact-input{ padding: 7px 20px 7px 6px !important; background-position: right 4px center; }
#order-form input[type="text"], #order-form select{ font-size: 0.85rem; }

.product-row{ display:flex; align-items:center; gap:10px; }
.product-row select{ flex:1; min-width:0; }
.checkbox-pill{
  display:inline-flex; align-items:center; gap:7px;
  flex-shrink:0;
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--ink);
  cursor:pointer;
  user-select:none;
  white-space: nowrap;
}
.checkbox-pill input{
  width: 16px; height: 16px;
  accent-color: var(--brass);
  cursor:pointer;
  flex-shrink:0;
}
input[type="text"], input[type="email"], input[type="tel"], select{
  width: 100%;
  padding: 11px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}
select{
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%2357617A' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
select:invalid{ color: var(--ink-faint); }
input:focus-visible, select:focus-visible{
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22,35,62,0.08);
}
input.invalid, select.invalid{ border-color: var(--error); }
.field-hint{
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 5px;
}
.address-details-label{
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}
.address-details-label .optional{ font-weight: 400; }
.field-hint.verified{ color: var(--success); font-weight: 600; }
.address-search-wrap{ position: relative; }
.address-suggestions{
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}
.address-suggestions.open{ display: block; }
.address-suggestion{
  padding: 9px 12px;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--line-soft);
}
.address-suggestion:last-child{ border-bottom: none; }
.address-suggestion:hover, .address-suggestion.active{ background: var(--brass-bg); }
.link-btn{
  display: inline-block;
  background: none;
  border: none;
  padding: 0;
  margin: 6px 0 0;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brass);
  cursor: pointer;
}
.fielderror{
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 5px;
  overflow-wrap: anywhere;
  line-height: 1.45;
  display:none;
}
.fielderror.show{ display:block; }

button.primary{
  width:100%;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
button.primary:hover:not(:disabled){ background: #0E1830; }
button.primary:active:not(:disabled){ transform: scale(0.99); }
button.primary:disabled{
  background: #C7CBD4;
  cursor: not-allowed;
}
button.ghost{
  width:100%;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
button.ghost:hover:not(:disabled){ border-color: var(--ink); }
button.ghost:disabled{ color: var(--ink-faint); cursor: not-allowed; }
button.link{
  background:none; border:none; padding:0;
  font-family:inherit; font-size:0.85rem; font-weight:600;
  color: var(--brass); cursor:pointer;
}
button.link:disabled{ color: var(--ink-faint); cursor:not-allowed; }

/* ---------- OTP boxes ---------- */
.otp-row{
  display:flex;
  gap: 8px;
  margin-bottom: 6px;
}
.otp-row input{
  width: 100%;
  min-width: 0;
  text-align:center;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 10px 0;
  letter-spacing: 0;
}
.demo-otp-banner{
  margin-bottom: 18px;
  padding: 10px 12px;
  background: var(--brass-bg);
  border: 1px dashed var(--brass-line);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--brass);
}
.demo-otp-banner strong{ letter-spacing: 0.04em; white-space: nowrap; }

/* ---------- Order hub ---------- */
.quota-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 18px;
  padding: 10px 12px;
  background: var(--line-soft);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.quota-row .count{ font-weight:600; color: var(--ink); }
.quota-bar{
  width: 90px; height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow:hidden;
}
.quota-bar > div{
  height:100%;
  background: var(--brass);
  transition: width 0.3s ease;
}

.limit-banner{
  padding: 9px 14px;
  background: var(--brass-bg);
  border: 1px solid var(--brass-line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 16px;
  line-height:1.4;
  text-align: center;
}
.limit-banner p{ margin: 0; }
.limit-banner a{ color: var(--brass); font-weight:600; }

.order-list{ margin-top: 22px; }
.order-list h2{
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-faint);
  margin: 0 0 10px;
  text-transform: none;
}
#order-list{
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
  margin-right: -4px;
}
#order-list::-webkit-scrollbar{ width: 6px; }
#order-list::-webkit-scrollbar-thumb{ background: var(--line); border-radius: 3px; }
#order-list{ scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.order-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.order-item .meta{ display:flex; flex-direction:column; min-width:0; overflow:hidden; margin-right:10px; }
.order-item .oid{ font-size: 0.85rem; font-weight:600; color: var(--ink); }
.order-item .ofile{ font-size: 0.76rem; color: var(--ink-faint); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.status-chip{
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.status-chip.submitted{ background: var(--success-bg); color: var(--success); }
/* PENDING/FAILED weren't in the prototype (its orders were always the mock
   "submitted" status) — added for the real order lifecycle
   (requirements.md §20, §50), using the same --error/--brass tokens the
   rest of the page already defines. */
.status-chip.pending{ background: var(--brass-bg); color: var(--brass); }
.status-chip.failed{ background: var(--error-bg); color: var(--error); }

.info-banner{
  padding: 9px 14px;
  background: var(--brass-bg);
  border: 1px solid var(--brass-line);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--ink);
  line-height:1.4;
  margin-bottom: 16px;
  text-align: center;
}
.info-banner strong{ color: var(--ink); }

/* ---------- Modal / result viewer ---------- */
.modal-overlay{
  position: fixed; inset: 0;
  background: rgba(16,22,38,0.55);
  display:none;
  align-items:center;
  justify-content:center;
  padding: 16px;
  z-index: 50;
}
.modal-overlay.open{ display:flex; }
.modal{
  background: var(--surface);
  width: 100%;
  max-width: 720px;
  height: min(82vh, 760px);
  border-radius: var(--radius-md);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head .oid{ font-size:0.92rem; font-weight:600; }
.modal-head button.close{
  background:none; border:none; cursor:pointer;
  font-size: 1.1rem; color: var(--ink-faint); line-height:1; padding:2px 4px;
}

/* ---------- Processing / misc ---------- */
.helper-row{
  display:flex; align-items:center; justify-content:space-between;
  margin-top: 6px;
}
.helper-row .small{ font-size: 0.82rem; color: var(--ink-faint); }

.footer-note{
  max-width: 480px;
  text-align:center;
  font-size: 0.76rem;
  color: var(--ink-faint);
  margin-top: 18px;
  line-height:1.5;
}

@media (prefers-reduced-motion: reduce){
  .status-chip.processing::before{ animation: none; }
}

@media (max-width: 420px) {
  .card-body { padding: 24px 18px; }
  .tracker .node { flex: 1 1 0; min-width: 0; }
  .tracker .label { white-space: normal; font-size: .64rem; max-width: 90px; }
  .tracker .connector { flex: 0 0 12px; margin: 0 2px; }
}
