*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:      #1e2433;
  --accent:       #9a7d3a;
  --accent-light: #c4a35a;
  --accent-glow:  rgba(154,125,58,.12);
  --danger:       #c0392b;
  --text:         #1a1f2e;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #f4f5f7;
  --white:        #fff;
  --radius:       10px;
  --radius-sm:    7px;
  --shadow:       0 2px 16px rgba(0,0,0,.07);
  --shadow-md:    0 4px 28px rgba(0,0,0,.10);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Loading ── */
#loading-screen {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; flex-direction: column; gap: 18px;
}
.spinner {
  width: 38px; height: 38px;
  border: 2.5px solid rgba(154,125,58,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loading-screen p { color: var(--text-muted); font-size: 0.88rem; font-weight: 500; }

/* ── Header ── */
.site-header {
  background: var(--primary);
  padding: 0 32px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  position: relative;
}
.site-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 60%);
}
.header-logo-img  { height: 40px; object-fit: contain; }
.header-logo-text { color: #fff; font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; }

/* ── Steps Bar ── */
.steps-bar {
  background: #161c28;
  display: flex;
  position: relative;
  overflow: hidden;
}
.steps-bar::before {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: rgba(255,255,255,.06);
}
.step {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 14px 8px;
  color: rgba(255,255,255,.3); font-size: 0.78rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  position: relative; transition: color .3s;
}
.step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.74rem; font-weight: 700;
  transition: background .3s, color .3s, box-shadow .3s;
  border: 1.5px solid rgba(255,255,255,.1);
}
.step.active { color: #fff; }
.step.active .step-num {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(154,125,58,.45);
}
.step.completed { color: rgba(255,255,255,.45); }
.step.completed .step-num {
  background: rgba(154,125,58,.25);
  color: var(--accent-light);
  border-color: rgba(154,125,58,.4);
}
/* Connector line between steps */
.step + .step::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 24px;
  background: rgba(255,255,255,.08);
}

/* ── Layout ── */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 36px 24px 60px; }
.quote-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }

/* ── Memorial Panel (Left) ── */
.memorial-panel { position: sticky; top: 20px; min-width: 0; }
.memorial-img-wrap {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
  aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
}
.memorial-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 20px; cursor: zoom-in; }

/* ── Image Lightbox ── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 18, 22, 0.92);
  align-items: center; justify-content: center; padding: 40px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; animation: lightbox-fade .18s ease; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img {
  max-width: 92vw; max-height: 88vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute; top: 18px; right: 22px;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 1.7rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); transform: scale(1.05); }
.memorial-info {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--border);
  padding: 22px; margin-top: 14px;
}
.memorial-name {
  font-size: 1.15rem; font-weight: 700; margin-bottom: 8px;
  color: var(--text); letter-spacing: -.02em;
}
.memorial-desc { color: var(--text-muted); font-size: 0.86rem; margin-bottom: 14px; line-height: 1.6; }
.memorial-sizes { display: flex; flex-direction: column; gap: 1px; }
.memorial-sizes p {
  font-size: 0.83rem; color: var(--text-muted);
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.memorial-sizes p:last-child { border-bottom: none; }
.not-found-msg {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 40px 22px; text-align: center; color: var(--text-muted);
}

/* ── Form Panel (Right) ── */
.form-panel {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden; min-width: 0;
  border: 1px solid var(--border);
}
.form-page { display: none; padding: 30px 28px; }
.form-page.active { display: block; }
.form-page h2 {
  font-size: 0.95rem; font-weight: 700; color: var(--text);
  margin-bottom: 24px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -.01em;
}
.form-page h2::before {
  content: attr(data-step);
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
}

/* ── Fields ── */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.8rem; font-weight: 600;
  margin-bottom: 6px; color: #374151; letter-spacing: .01em;
}
.req { color: var(--danger); margin-left: 2px; }
.hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

.field input:not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.88rem; font-family: inherit; color: var(--text);
  background: #fff; transition: border-color .2s, box-shadow .2s;
  appearance: none;
}
.field input[type="checkbox"],
.field input[type="radio"] {
  width: auto; height: auto; padding: 0;
  border: none; background: transparent; appearance: auto; flex-shrink: 0; cursor: pointer;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field select {
  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='%239ca3af' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field input[type="file"] {
  padding: 8px; border: 1.5px dashed var(--border);
  cursor: pointer; font-size: 0.83rem; border-radius: var(--radius-sm);
  background: #fafafa;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.err-msg { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }
.conditional-field { display: none; }
.conditional-field.visible { display: block; }

/* ── Colour Grid ── */
.colour-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.colour-option { display: none; }
.colour-label {
  cursor: pointer; text-align: center;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  padding: 6px 4px; transition: border-color .15s, background .15s;
}
.colour-label:hover { border-color: var(--accent-light); }
.colour-label img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 5px; display: block; margin-bottom: 5px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.colour-label span { font-size: 0.68rem; color: var(--text-muted); display: block; font-weight: 500; }
.colour-option:checked + .colour-label {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.colour-option:checked + .colour-label span { color: var(--accent); font-weight: 700; }

/* ── Inscription Suggestions ── */
.suggestion-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-glow); color: var(--accent);
  border: 1px solid rgba(154,125,58,.3);
  font-size: 0.8rem; font-weight: 600; padding: 7px 14px;
  border-radius: var(--radius-sm); cursor: pointer; margin-bottom: 16px;
  user-select: none; transition: background .15s;
}
.suggestion-toggle:hover { background: rgba(154,125,58,.18); }
.suggestion-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  z-index: 9999; overflow-y: auto; padding: 40px 16px;
}
.suggestion-modal.open { display: flex; align-items: flex-start; justify-content: center; }
.suggestion-inner {
  background: #fff; border-radius: 14px;
  padding: 30px 28px; max-width: 580px; width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.suggestion-close {
  position: absolute; top: 14px; right: 16px; font-size: 1.4rem;
  cursor: pointer; background: none; border: none; color: #9ca3af; line-height: 1;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.suggestion-close:hover { background: #f3f4f6; color: var(--text); }
.suggestion-inner h3 { font-size: 0.82rem; color: var(--accent); margin: 16px 0 6px; font-weight: 700; }
.suggestion-inner h3:first-of-type { margin-top: 0; }
.suggestion-inner ul { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 3px; }
.suggestion-inner li {
  font-size: 0.84rem; padding: 5px 10px; line-height: 1.5;
  border-radius: 5px; cursor: pointer; transition: background .12s; color: var(--text-muted);
}
.suggestion-inner li:hover { background: #f9fafb; color: var(--text); }

/* ── Consent ── */
.consent-wrap { display: flex; align-items: flex-start; gap: 11px; }
.consent-wrap input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.consent-wrap label {
  font-size: 0.83rem; color: var(--text-muted); flex: 1; min-width: 0;
  overflow-wrap: break-word; cursor: pointer; line-height: 1.55;
}
.consent-wrap a { color: var(--accent); text-decoration: none; }
.consent-wrap a:hover { text-decoration: underline; }

/* ── Navigation Buttons ── */
.form-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 28px; border-top: 1px solid var(--border);
  background: #fafafa;
}
.btn {
  padding: 10px 24px; border-radius: var(--radius-sm);
  font-size: 0.87rem; font-weight: 600; cursor: pointer; border: none;
  transition: opacity .18s, transform .12s, box-shadow .18s;
  font-family: inherit; letter-spacing: .01em;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #7d6030);
  color: #fff;
  box-shadow: 0 2px 12px rgba(154,125,58,.3);
}
.btn-primary:hover { opacity: .92; box-shadow: 0 4px 20px rgba(154,125,58,.4); }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid var(--border); }
.btn-secondary:hover { background: #e9eaec; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

/* ── Success Screen ── */
.success-screen { display: none; padding: 52px 28px; text-align: center; }
.success-screen.active { display: block; }
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; color: #fff;
  box-shadow: 0 6px 20px rgba(154,125,58,.35);
}
.success-screen h2 { font-size: 1.25rem; margin-bottom: 10px; font-weight: 700; letter-spacing: -.02em; }
.success-screen p  { color: var(--text-muted); font-size: 0.9rem; max-width: 340px; margin: 0 auto; line-height: 1.65; }

/* ── Footer ── */
.site-footer { text-align: center; padding: 24px; color: #9ca3af; font-size: 0.77rem; margin-top: 8px; }
.site-footer-credit { margin-top: 4px; font-size: 0.73rem; color: #d1d5db; }
.site-footer-credit a { color: #b0b7c3; text-decoration: none; }
.site-footer-credit a:hover { color: #9ca3af; text-decoration: underline; }
.ty-credit { margin-top: 20px; font-size: 0.73rem; color: #c9cdd6; text-align: center; width: 100%; }
.ty-credit a { color: #b0b7c3; text-decoration: none; }
.ty-credit a:hover { text-decoration: underline; }

/* ── Error Page ── */
.error-page { max-width: 500px; margin: 80px auto; text-align: center; padding: 0 20px; }
.error-page h1 { font-size: 1.3rem; margin-bottom: 12px; font-weight: 700; }
.error-page p  { color: var(--text-muted); line-height: 1.65; }

/* ── Thank You Page ── */
.ty-page {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px;
}
.ty-card {
  background: var(--white); border-radius: 18px;
  box-shadow: 0 8px 48px rgba(0,0,0,.10);
  border: 1px solid var(--border);
  padding: 56px 48px; max-width: 520px; width: 100%; text-align: center;
}
.ty-check {
  width: 76px; height: 76px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 2.1rem; color: #fff;
  box-shadow: 0 6px 24px rgba(154,125,58,.4);
}
.ty-heading { font-size: 1.75rem; font-weight: 700; color: var(--text); margin-bottom: 12px; letter-spacing: -.03em; }
.ty-memorial { font-size: 0.98rem; color: var(--text-muted); margin-bottom: 10px; }
.ty-memorial strong { color: var(--text); font-weight: 600; }
.ty-message  { font-size: 0.93rem; color: var(--text-muted); line-height: 1.75; margin-bottom: 28px; }
.ty-divider  { width: 48px; height: 3px; background: var(--accent); border-radius: 2px; margin: 0 auto 20px; }
.ty-company  { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 28px; letter-spacing: .06em; text-transform: uppercase; }
.ty-return-btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), #7d6030);
  color: #fff; padding: 14px 34px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; text-decoration: none;
  transition: opacity .2s, box-shadow .2s;
  box-shadow: 0 2px 14px rgba(154,125,58,.3);
}
.ty-return-btn:hover { opacity: .9; box-shadow: 0 4px 22px rgba(154,125,58,.45); }
@media (max-width: 560px) { .ty-card { padding: 38px 24px; } .ty-heading { font-size: 1.45rem; } }

/* ── Responsive ── */
@media (max-width: 880px) {
  .quote-layout { grid-template-columns: 1fr; }
  .memorial-panel { position: static; }
}
@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; }
  .colour-grid { gap: 5px; }
  .colour-label span { display: none; }
  .form-page, .form-nav { padding: 18px 14px; }
  .page-wrap { padding: 16px 12px 48px; }
  .site-header { padding: 0 18px; }
  .step span { display: none; }
}
