/* Background with dynamic hero */
:root { --hero-url: url('/img/heart-bkg.jpg'); }
body {
  font-family: Arial, sans-serif;
  background-image: var(--hero-url);
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-size: cover;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}
body::before { content: ""; position: absolute; inset: 0; background: rgba(255,255,255,0.45); pointer-events: none; }

.form-container { width: 92%; max-width: 980px; background: #fff; padding: 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); position: relative; z-index: 1; }
.form-group { margin-bottom: 20px; }
.form-title { margin-top: 0; }
.cost-notice { font-style: italic; color: #333; }

#payment-form input[type="text"], #payment-form textarea { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 16px; box-sizing: border-box; margin-top: 6px; }
#payment-form button { padding: 14px 16px; border: none; background-color: #ff6b6b; color: white; cursor: pointer; border-radius: 8px; font-size: 16px; transition: background-color 0.2s ease; }
#payment-form button:hover { background-color: #ff5a5a; }
.error { color: #b00020; margin-top: 8px; }

.step-actions { display:flex; gap:10px; justify-content: space-between; align-items:center; margin-top: 12px; }
button.secondary { background: #f4f4f4; color: #333; }
button.secondary:hover { background: #ededed; }
.linklike { background: transparent; color: #0b6cff; padding: 6px 8px; border-radius: 6px; }
.linklike:hover { background: rgba(11,108,255,0.08); }

/* Side-by-side preview layout */
.design-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 6px 0 14px; }
.design-pane .preview-card { width: 100%; border: 1px solid #eee; background: #fff; border-radius: 12px; overflow: hidden; min-height: 200px; }
.preview-card canvas { width: 100%; height: auto; display: block; }
.card-preview-image { width: 100%; height: auto; display: block; }
.preview-footnote { display:block; color:#666; margin-top:6px; font-size:12px; text-align:center; }

/* Handwriting options */
.handwriting-options { display:flex; gap:12px; justify-content:space-between; margin: 10px 0 4px; }
.hw-option { width:32%; }
.hw-option img { display:block; width:100%; height:auto; border-radius:8px; border:1px solid #eee; transition: transform .15s ease; }
.hw-option img:hover { transform: translateY(-2px); }
input[type=radio] { display:none; }
input[type=radio]:checked + img { outline: 2px solid #ff6b6b; outline-offset: 2px; }

/* Card picker */
.card-picker { margin-top: 12px; }
.card-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.card-search { flex: 0 0 280px; max-width: 50%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; }
.card-row { display:flex; gap:12px; overflow-x:auto; padding-bottom: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.card-grid-empty { padding: 12px; text-align: center; color: #666; }
.card-option { display: block; border: 1px solid #eee; border-radius: 10px; padding: 8px; text-align: center; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; min-width: 160px; }
.card-option:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.card-thumb { position: relative; }
.card-option img { width: 100%; border-radius: 8px; }
.card-option input { display:none; }
.card-option input:checked + .card-thumb img { outline: 2px solid #ff6b6b; outline-offset: 2px; }
.card-name { margin-top: 6px; font-size: 14px; color: #333; }

.chip { position:absolute; top:8px; left:8px; background:#111; color:#fff; font-size:11px; padding:3px 6px; border-radius:999px; }
.chip-premium { background: linear-gradient(90deg,#B8860B,#DAA520); color:#111; }

.card-pagination { display:flex; align-items:center; justify-content:center; gap:12px; margin-top: 12px; }
.card-page-btn { padding: 8px 12px; border-radius: 8px; border: 1px solid #ddd; background: #fafafa; cursor: pointer; }
.card-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.card-page-label { font-size: 14px; color: #333; }

/* Stripe element */
#card-element { border: 1px solid #ddd; border-radius: 8px; width: 100%; height: 44px; padding: 10px; box-sizing: border-box; }

/* Progress bar */
.progress { width: 100%; max-width: 980px; height: 6px; background: rgba(0,0,0,0.08); border-radius: 999px; margin: 18px auto 12px; position: relative; z-index: 1; }
.progress-bar { height: 100%; width: 20%; border-radius: 999px; transition: width 0.25s ease; background: #ff6b6b; }

#charCounter { display:block; text-align:right; opacity:0.7; font-size:12px; margin-top:6px; }

/* Responsive */
@media (max-width: 900px) {
  .design-preview { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .card-search { max-width: 100%; flex: 1 1 auto; }
}
/* Validation states */
.input-error {
  border-color: #d93025 !important;
  outline: none;
  box-shadow: 0 0 0 2px rgba(217,48,37,0.08);
}
.field-error {
  color: #d93025;
  font-size: 12px;
  margin-top: 6px;
}
