/* =========================================================
   PH1 Parking Portal — components + layout
   ========================================================= */

/* ---------- Layout primitives ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.main { flex: 1; padding: 36px 0 80px; }
.row { display: flex; gap: 14px; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.wrap-narrow { max-width: 760px; }
.muted { color: var(--text-dim); }
.center { text-align: center; }
.grow { flex: 1; }
.gap-sm { gap: 8px; }
.mt-s { margin-top: 8px; } .mt-m { margin-top: 18px; } .mt-l { margin-top: 32px; }
.nowrap { white-space: nowrap; }

/* ---------- Topbar / masthead ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(6, 19, 32, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand-mark {
  font-family: 'Newsreader', serif; font-style: italic; font-weight: 400;
  font-size: 21px; color: var(--text); letter-spacing: -0.01em;
}
.brand-tag { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-faint); }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.who { text-align: right; line-height: 1.25; }
.who-role { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); }
.who-name { font-size: 13px; color: var(--text-dim); }

/* ---------- Section label ---------- */
.section-label {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-faint);
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px;
}
.section-label .num { color: var(--accent); }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Page heading ---------- */
.page-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.page-title { font-family: 'Newsreader', serif; font-weight: 300; font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1.04; letter-spacing: -0.02em; }
.page-title .italic { font-style: italic; color: var(--accent); }
.page-sub { color: var(--text-dim); font-size: 15px; margin-top: 12px; max-width: 620px; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-deep));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 24px; }
.card-hd { padding: 18px 24px; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 12px; }
.card-hd h3 { font-family: 'Newsreader', serif; font-weight: 400; font-size: 19px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.panel-quiet { background: rgba(255,255,255,0.015); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 16px 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 500; letter-spacing: 0.01em;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: all 0.16s ease; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #1a1206; border-color: var(--accent); }
.btn-primary:not(:disabled):hover { background: #d8b87f; box-shadow: 0 8px 22px -10px rgba(201,166,107,0.6); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:not(:disabled):hover { border-color: var(--text-dim); background: rgba(255,255,255,0.03); }
.btn-quiet { background: transparent; color: var(--text-dim); padding: 8px 12px; }
.btn-quiet:hover { color: var(--text); }
.btn-danger { background: transparent; color: var(--bad); border-color: rgba(201,122,107,0.4); }
.btn-danger:hover { background: var(--bad-soft); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 15px; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-faint);
}
.input, input.input, select.input, textarea.input {
  width: 100%; background: var(--bg-deep); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 11px 13px; font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 300;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23C9A66B' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.field-grid { display: grid; gap: 16px; }
.field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.field-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.field-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.field-hint { font-size: 12px; color: var(--text-faint); }
.field-error { font-size: 12px; color: var(--bad); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 100px; border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: var(--ok-soft); border-color: rgba(111,181,138,0.3); }
.badge-warn { color: var(--warn); background: var(--warn-soft); border-color: rgba(216,178,106,0.3); }
.badge-bad { color: var(--bad); background: var(--bad-soft); border-color: rgba(201,122,107,0.3); }
.badge-info { color: var(--accent-blue); background: rgba(74,122,171,0.14); border-color: rgba(74,122,171,0.3); }
.badge-neutral { color: var(--text-dim); background: rgba(255,255,255,0.04); border-color: var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim);
  background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: 100px; padding: 5px 12px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 9.5px;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint);
  padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 400; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--text-dim); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.clickable { cursor: pointer; transition: background 0.12s; }
.table tr.clickable:hover { background: rgba(255,255,255,0.025); }
.table td strong { color: var(--text); font-weight: 500; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; }
.login-hero { padding: 64px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(ellipse at 30% 20%, rgba(74,122,171,0.2), transparent 60%), var(--bg-deep);
  border-right: 1px solid var(--line); position: relative; }
.login-hero-title { font-family: 'Newsreader', serif; font-weight: 300; font-size: clamp(40px, 4.6vw, 66px);
  line-height: 0.98; letter-spacing: -0.025em; }
.login-hero-title .italic { font-style: italic; color: var(--accent); }
.login-form-side { padding: 64px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.demo-logins { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.demo-login {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 16px; cursor: pointer; transition: all 0.15s; width: 100%;
}
.demo-login:hover { border-color: var(--accent); background: var(--surface-2); transform: translateX(2px); }
.demo-login .dl-name { font-size: 14px; color: var(--text); font-weight: 400; }
.demo-login .dl-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; } .login-form-side { padding: 40px 24px; } }

/* ---------- Dashboard ---------- */
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  flex-wrap: wrap; margin-bottom: 28px; }
.addr-chip { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.due-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .due-grid { grid-template-columns: 1fr; } }
.due-card { position: relative; overflow: hidden; }
.due-card.is-locked { opacity: 0.92; }
.due-card .due-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.due-card.is-locked .due-accent { background: var(--text-faint); }
.due-card.is-done .due-accent { background: var(--ok); }
.line-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: none; }
.veh-make { color: var(--text); font-weight: 400; }
.veh-meta { font-size: 12.5px; color: var(--text-faint); }
.gate-note { display: flex; gap: 12px; align-items: flex-start; background: var(--warn-soft);
  border: 1px solid rgba(216,178,106,0.3); border-radius: var(--radius-sm); padding: 14px 16px; }
.gate-note .lock { color: var(--warn); flex-shrink: 0; }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: center; gap: 0; margin-bottom: 30px; }
.stepper .step { display: flex; align-items: center; gap: 10px; }
.stepper .step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--text-faint); }
.stepper .step.active .step-dot { background: var(--accent); color: #1a1206; border-color: var(--accent); }
.stepper .step.done .step-dot { border-color: var(--ok); color: var(--ok); }
.stepper .step-name { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint); }
.stepper .step.active .step-name { color: var(--text); }
.stepper .step-line { width: 38px; height: 1px; background: var(--line); margin: 0 12px; }

/* ---------- e-sign + upload ---------- */
.esign { background: var(--bg-deep); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.esign-preview { font-family: 'Newsreader', serif; font-style: italic; font-size: 28px; color: var(--accent);
  min-height: 38px; }
.upload { display: flex; align-items: center; gap: 14px; background: var(--bg-deep);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer;
  transition: border-color 0.15s; }
.upload:hover { border-color: var(--accent); }
.upload.has-file { border-style: solid; border-color: rgba(111,181,138,0.4); }
.upload-icon { color: var(--text-faint); }
.upload.has-file .upload-icon { color: var(--ok); }

/* ---------- Checkout ---------- */
.checkout-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-bottom: 1px solid var(--line); }
.checkout-total { display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--line-strong); }
.checkout-total .amt { font-family: 'Newsreader', serif; font-size: 30px; color: var(--text); }
.test-ribbon { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--warn); background: var(--warn-soft);
  border: 1px solid rgba(216,178,106,0.3); border-radius: 5px; padding: 5px 9px; }
.payee-tag { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-faint); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(2, 8, 14, 0.7);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: linear-gradient(180deg, var(--surface), var(--bg-deep)); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 30px 80px -30px #000; max-width: 520px; width: 100%;
  padding: 28px; animation: pop 0.16s ease; }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Toast ---------- */
.toast-host { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: 100px; padding: 11px 20px; font-size: 13.5px;
  box-shadow: var(--shadow); animation: pop 0.16s ease; }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---------- Demo guide ---------- */
.demo-fab { position: fixed; right: 22px; bottom: 22px; z-index: 120; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty .serif-italic { font-size: 22px; color: var(--text-dim); display: block; margin-bottom: 6px; }

@media (max-width: 720px) {
  .field-grid.cols-2, .field-grid.cols-3, .field-grid.cols-4 { grid-template-columns: 1fr; }
  .wrap { padding: 0 18px; }
}
