/* =====================================================================
   VOMELA — Business Card Ordering Portal
   Brand system per Brand-Guide-VOM-20260108.
   Palette: neutrals dominant, Sapphire core. Card proof matches the
   approved artwork exactly (colors/positions sampled from pod artwork.pdf).
   Fonts: Aptos -> Arial -> sans-serif (guide's web-safe fallback chain).
   ===================================================================== */

:root {
  /* Core brand */
  --sapphire: #004169;
  --sapphire-deep: #003253;
  --onyx: #0f0f0f;
  --slate: #4b4b4b;
  --granite: #e6e6e6;
  --quartz: #ffffff;

  /* Card artwork (sampled) */
  --card-magenta: #ea018c;
  --card-navy: #085281;
  --card-back-blue: #075281;

  /* Semantic (light theme) */
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --text: #14181d;
  --text-muted: #5b6572;
  --line: #dfe4ea;
  --primary: var(--sapphire);
  --primary-contrast: #ffffff;
  --danger: #d73c37;
  --focus: rgba(0, 65, 105, 0.28);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.08);
  --shadow-card: 0 18px 40px rgba(16, 24, 40, 0.22);
  --maxw: 1180px;

  --font: "Aptos", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0c1116;
  --surface: #141b22;
  --surface-2: #10161c;
  --text: #eef2f6;
  --text-muted: #9aa7b4;
  --line: #263039;
  --primary: #2f7fb5;
  --primary-contrast: #06131d;
  --focus: rgba(47, 127, 181, 0.4);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ============================ HEADER ============================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo { height: 34px; width: auto; }
[data-theme="dark"] .site-logo { content: url("../assets/logo-white.png"); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--text); }
.theme-toggle__icon { font-size: 1rem; line-height: 1; }

/* ============================= HERO ============================= */
.hero {
  background:
    radial-gradient(1200px 380px at 78% -60%, rgba(0, 65, 105, 0.10), transparent 60%),
    var(--bg);
}
.hero__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 2rem 0.5rem;
  text-align: center;
}
.hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  letter-spacing: -0.01em;
  line-height: 1.08;
}
.hero__lead {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--sapphire);
}
[data-theme="dark"] .hero__lead { color: var(--text); }
.hero__body {
  margin: 0 auto 1.4rem;
  max-width: 70ch;
  color: var(--text-muted);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  text-align: left;
}
@media (max-width: 720px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .steps { grid-template-columns: 1fr; } }
.steps li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.86rem;
  line-height: 1.35;
  color: var(--text-muted);
}
.steps__num {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--sapphire);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 0.05rem;
}
.hero__note {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================ LAYOUT =========================== */
/* Two independent columns so tiles pack without cross-column row gaps:
   left  = Card Details (top)  + Shipping (bottom)
   right = Digital Proof (top) + Approve & Submit (bottom)  */
.grid { max-width: var(--maxw); margin: 0 auto; padding: 1rem 2rem 2.5rem; }
.cols {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (max-width: 900px) {
  .cols { flex-direction: column; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.35rem 1.3rem;
  box-shadow: var(--shadow);
  margin: 0;
}
.card legend {
  font-weight: 700;
  font-size: 1rem;
  padding: 0;
  color: var(--text);
}
.fieldset-hint {
  margin: 0.15rem 0 0.9rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.field { margin-bottom: 0.8rem; }
.field:last-child { margin-bottom: 0; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.field-row--city { grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 520px) {
  .field-row, .field-row--city { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}
.req { color: var(--danger); font-weight: 700; }

input[type="text"],
input[type="email"],
input[type="tel"] {
  display: block;
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder { color: var(--text-muted); opacity: 0.7; }
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus);
}
input.invalid { border-color: var(--danger); }
input.invalid:focus { box-shadow: 0 0 0 3px rgba(215, 60, 55, 0.2); }

.field-hint {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.error {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  color: var(--danger);
  min-height: 0;
}
.error:empty { display: none; }

/* ------------------------- APPROVE & SUBMIT ------------------ */
.order-summary { border-top: 3px solid var(--sapphire); }

.attest {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1.1rem 0 0.4rem;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.5;
  cursor: pointer;
}
.attest input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  accent-color: var(--sapphire);
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  margin-top: 1rem;
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.2rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s, opacity 0.15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

/* ============================ PREVIEW ========================== */
.preview-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.5rem;
  box-shadow: var(--shadow);
}
.preview-title { margin: 0 0 0.2rem; font-size: 1.05rem; }
.preview-sub { margin: 0 0 1rem; font-size: 0.84rem; color: var(--text-muted); }

.proof { margin: 0 0 1rem; }
.proof:last-child { margin-bottom: 0; }
.proof__cap {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

/* -------- the card itself: fixed proof, matches print artwork ---- */
.bcard {
  width: 100%;
  aspect-ratio: 252 / 144;   /* 3.5in x 2in */
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  container-type: size;       /* enables cqh/cqw sizing for overlay */
}
.bcard--front {
  background: #fff url("../assets/card-front-bg.png") center / cover no-repeat;
}
.bcard--back { background: var(--card-back-blue); }
.bcard--back img { width: 100%; height: 100%; object-fit: cover; }

/* Variable-data text renders in black like the static card copy;
   the Full Name is printed in the brand navy (no angle brackets). */
.vd { color: #000; }
.vd.is-placeholder { color: rgba(0, 0, 0, 0.32); }

.cf-name.vd { color: var(--card-navy); }
.cf-name.vd.is-placeholder { color: rgba(0, 2, 29, 0.32); }

/* Identity block (name + title), top-left */
.cf-identity { position: absolute; left: 5.6%; top: 6.6%; right: 34%; }
.cf-name {
  font-size: 8cqh;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.cf-title {
  font-size: 5cqh;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.6cqh;
}

/* Contact rows, upper-middle-left */
.cf-contact {
  position: absolute;
  left: 5.6%;
  top: 33.5%;
  right: 30%;
  display: flex;
  flex-direction: column;
  gap: 1.35cqh;
}
.cf-row { display: flex; align-items: baseline; }
.cf-label {
  flex: 0 0 9.6cqw;
  color: var(--card-navy);
  font-size: 3.6cqh;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
}
[data-theme] .cf-label { color: var(--card-navy); } /* stays navy in any theme */
.cf-val { font-size: 5cqh; line-height: 1; }

/* Website (static), lower-left */
.cf-web {
  position: absolute;
  left: 5.4%;
  top: 62.5%;
  color: var(--card-navy);
  font-size: 5.2cqh;
  font-weight: 700;
  line-height: 1;
}

/* Address block, bottom-left */
.cf-address {
  position: absolute;
  left: 5.4%;
  top: 70%;
  right: 30%;
  display: flex;
  flex-direction: column;
  gap: 1.4cqh;
}
.cf-addr-line { font-size: 5cqh; line-height: 1; }

/* ============================ FOOTER ========================== */
.site-footer {
  background: var(--sapphire);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 2rem;
}
.footer-logo { height: 30px; width: auto; margin: 0 auto 0.75rem; }
.site-footer p { margin: 0; font-size: 0.82rem; }

/* ============================= MODAL ========================== */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 22, 0.55);
  backdrop-filter: blur(2px);
}
.modal__box {
  position: relative;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 2.25rem 2rem 1.75rem;
  max-width: 440px;
  width: calc(100% - 2rem);
  text-align: center;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  animation: pop 0.2s ease-out;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal__check {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--sapphire);
  color: #fff;
  font-size: 1.8rem;
  display: grid;
  place-items: center;
}
.modal__box h2 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.modal__box p { margin: 0 0 1rem; color: var(--text-muted); }
.modal__ref { font-size: 0.82rem; font-weight: 600; color: var(--text) !important; }
.modal__box .btn-primary { width: auto; padding: 0.7rem 2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .modal__box { animation: none; }
}
