/*
 * WA Pro Se — Order Form styling.
 * Brand color #17606D matches waprose.com header.
 */

:root {
  --bg: #ffffff;
  --surface: #f7f7f8;
  --ink: #0e0e10;
  --muted: #5c5c66;
  --accent: #c8841d;
  --accent-deep: #8a5a13;
  --brand: #17606D;      /* teal from waprose.com */
  --brand-deep: #0f4650;
  --border: #d8d8de;
  --error: #b22222;
  --ok: #197b3a;
  --max-width: 880px;
}

* {
  box-sizing: border-box;
}

/* The hidden attribute must always win, even on elements that have an
   explicit display rule (e.g. .field { display: block }). Without this,
   conditional fields stay visible when JS sets el.hidden = true. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent-deep); }

.page-header {
  background: var(--brand);
  color: #fff;
  padding: 0 24px;
  border-bottom: 4px solid var(--brand-deep);
}
.brand { max-width: var(--max-width); margin: 0 auto; }
.brand h1 { margin: 0; font-size: 28px; letter-spacing: 0.5px; }
.brand-logo { max-height: 120px; display: block; }
.brand-tag { margin: 4px 0 0; color: #cfcfd6; font-size: 14px; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 80px;
}

h2 {
  margin: 0 0 8px;
  font-size: 24px;
}
.intro {
  color: var(--muted);
  margin: 4px 0 16px;
}
/* Bold-red bullet warnings (per Jessica, May 8). */
.intro-warning {
  color: var(--error);
}
.intro-warning li {
  font-weight: 700;
  color: var(--error);
}

/* Additional recipient blocks (dynamically added for multi-party SOP). */
.sop-recipient-block {
  margin-top: 20px;
  border-top: 2px solid var(--border);
  padding-top: 4px;
}

/* Signature pad canvas. */
.signature-pad-wrap {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  margin: 6px 0 4px;
  overflow: hidden;
}
.signature-canvas {
  width: 100%;
  height: 180px;
  display: block;
  cursor: crosshair;
  touch-action: none;
  background: var(--bg);
}
.signature-canvas.error {
  outline: 2px solid var(--error);
}
.signature-clear {
  font-size: 13px;
}

/* Auto-applied single-option tier display (E-Filing, Service by Mail). */
.auto-applied {
  display: inline-block;
  margin: 4px 0;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-weight: 600;
}

/* Order summary / subtotal breakdown (per Jessica, May 8). */
.subtotal-breakdown {
  margin: 18px 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.subtotal-breakdown h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--ink);
}
.subtotal-breakdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.subtotal-breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.subtotal-breakdown li:last-child {
  border-bottom: 0;
}
.subtotal-breakdown li .amt {
  font-variant-numeric: tabular-nums;
}
.subtotal-breakdown li.breakdown-group-header {
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 0 2px;
  border-bottom: none;
  justify-content: flex-start;
}
.subtotal-breakdown li.breakdown-item {
  padding-left: 12px;
  font-size: 14px;
}
.subtotal-breakdown li.breakdown-total {
  font-weight: 700;
  margin-top: 6px;
  border-top: 2px solid var(--border);
  padding-top: 8px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin: 24px 0;
  background: var(--bg);
}
fieldset.nested {
  background: var(--surface);
  margin: 16px 0;
}
legend {
  font-weight: 600;
  font-size: 18px;
  padding: 0 8px;
  color: var(--ink);
}

.field {
  display: block;
  margin: 14px 0;
}
.field .label {
  display: block;
  font-weight: 500;
  margin-bottom: 4px;
}
.field small {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 13px;
}
.req { color: var(--error); }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="number"],
.field input[type="datetime-local"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }

.field input[type="file"] {
  font-size: 14px;
}

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 6px 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
}
.check input { margin-top: 3px; }

/* Address hint shown inline beside each court radio label. */
.court-addr-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.check.inline {
  display: inline-flex;
  align-items: center;
  margin: 0;
}
.check.inline input { margin-top: 0; }

.yes-no {
  display: inline-flex;
  gap: 18px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 4px;
}

.note {
  background: #fff8e8;
  border-left: 3px solid var(--accent);
  padding: 10px 12px;
  font-size: 14px;
  color: #614013;
  margin: 12px 0;
  border-radius: 0 6px 6px 0;
}

.form-note {
  margin: 12px 0 16px;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}
.form-note strong { color: var(--error); }

.money-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.money-prefix {
  padding: 10px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}
.money-input input {
  flex: 1;
  border: 0;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
}
.money-input input:focus {
  outline: none;
  background: #fafafa;
}


.stripe-card {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  margin-top: 4px;
}
.stripe-card.StripeElement--focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(200, 132, 29, 0.15);
}
.stripe-card.StripeElement--invalid {
  border-color: var(--error);
}

.section-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 4px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.radio-group.error {
  border-color: var(--error);
  background: #fff7f7;
}

.submit-row {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}
#submit_btn {
  padding: 14px 24px;
  font-size: 16px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
#submit_btn:hover:not(:disabled) { background: var(--accent-deep); }
#submit_btn:disabled { opacity: 0.6; cursor: not-allowed; }

.status { margin: 0; font-size: 14px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--error); }

.form-errors {
  background: #fdecea;
  border: 1px solid var(--error);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0 24px;
  color: #7a1818;
}
.form-errors strong { display: block; margin-bottom: 6px; }
.form-errors ul { margin: 4px 0 0; padding-left: 20px; }
.form-errors li { margin: 2px 0; }

.field input.error,
.field select.error,
.field textarea.error {
  border-color: var(--error);
  background: #fff7f7;
}
.yes-no.error {
  border-color: var(--error);
  background: #fff7f7;
}
.field-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 4px;
}

.page-footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Document upload slots — one row per document with name, file, remove. */
.doc-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.doc-slot {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--surface);
}
.doc-slot-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}
.doc-slot .field {
  margin: 0;
}
.doc-slot-remove {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--error);
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
.doc-slot-remove:hover {
  background: #fee;
  border-color: var(--error);
}
.doc-slot-pages {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  min-height: 1em;
}
.doc-pages-total {
  margin: 4px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.doc-print-note {
  margin: 6px 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.doc-print-fee-live {
  margin: 2px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-deep);
}
.link-button {
  background: none;
  border: 0;
  color: var(--accent-deep);
  font: inherit;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
}
.link-button:hover {
  color: var(--accent);
}
@media (max-width: 600px) {
  .doc-slot-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Multi-page wizard tabs ---- */
.wizard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 1.5rem 0 0;
  border-bottom: 2px solid var(--border);
  padding: 0;
}
.wizard-tab {
  padding: 0.55rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--muted);
  position: relative;
  transition: background 0.12s, color 0.12s;
  margin-right: 3px;
  margin-bottom: -2px;
}
.wizard-tab:hover {
  background: #eee;
  color: var(--ink);
}
.wizard-tab.active {
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
  color: var(--ink);
  font-weight: 700;
  z-index: 1;
}
.wizard-tab.has-errors::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--error);
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
}

/* ---- Wizard page containers ---- */
.wizard-page {
  /* No extra spacing — the fieldsets inside provide their own margin. */
}

/* ---- Wizard navigation row (Back / Next / Submit) ---- */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.wizard-back-btn {
  padding: 0.6rem 1.3rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  transition: background 0.12s;
}
.wizard-back-btn:hover {
  background: var(--surface);
}
.wizard-next-btn {
  padding: 0.7rem 1.8rem;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s;
}
.wizard-next-btn:hover:not(:disabled) {
  background: var(--accent-deep);
}
.wizard-next-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

