:root {
  --ivory: #f8f1e4;
  --paper: #fffcf5;
  --maroon: #651b2a;
  --maroon-deep: #3e101c;
  --maroon-night: #24070f;
  --gold: #c9963d;
  --gold-bright: #e8c574;
  --gold-soft: rgba(201, 150, 61, 0.35);
  --ink: #2a1d18;
  --muted: #7d6a60;
  --line: rgba(101, 27, 42, 0.14);
  --error: #9a2f2f;
  --success: #2f6a43;
  --sans: "DM Sans", "Noto Sans Devanagari", system-ui, sans-serif;
  --devanagari: "Noto Sans Devanagari", "DM Sans", system-ui, sans-serif;
  --serif: "Noto Serif Devanagari", "Cormorant Garamond", Georgia, serif;
  --display-en: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html { background: var(--maroon-night); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); font-family: var(--devanagari); background: var(--ivory); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Top band */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px max(16px, calc((100% - 1040px) / 2)); background: var(--paper); border-bottom: 1px solid var(--gold-soft); }
.brand-logo { display: block; width: 150px; height: auto; }
.topbar-note { margin: 0; text-align: right; color: var(--maroon); font-family: var(--serif); font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.topbar-note span { display: block; color: var(--muted); font-family: var(--display-en); font-size: 0.85rem; font-style: italic; font-weight: 500; letter-spacing: 0.04em; }

/* Hero */
.hero { position: relative; display: flex; flex-direction: column; align-items: center; padding: 44px 16px 150px; overflow: hidden; background:
  radial-gradient(ellipse at 50% 38%, rgba(232, 197, 116, 0.28), transparent 55%),
  repeating-conic-gradient(from 0deg at 50% 38%, rgba(232, 197, 116, 0.05) 0deg 6deg, transparent 6deg 12deg),
  linear-gradient(180deg, var(--maroon-deep) 0%, var(--maroon) 55%, var(--maroon-deep) 100%); }
.hero::before, .hero::after { content: ""; position: absolute; left: 0; right: 0; height: 10px; background: repeating-linear-gradient(90deg, transparent 0 14px, var(--gold-soft) 14px 16px); opacity: 0.7; }
.hero::before { top: 14px; }
.hero::after { bottom: 112px; opacity: 0.35; }
.hero-glow { position: absolute; top: 8%; width: min(620px, 120vw); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 214, 140, 0.32), transparent 62%); filter: blur(10px); pointer-events: none; }
.hero-art { position: relative; width: min(470px, 92vw); height: auto; filter: drop-shadow(0 24px 40px rgba(20, 3, 8, 0.55)); animation: lift-in 0.9s ease both; }
.hero-kicker { position: relative; display: flex; align-items: center; gap: 14px; margin: 26px 0 0; color: var(--gold-bright); font-family: var(--display-en); font-size: 1.15rem; font-style: italic; letter-spacing: 0.08em; animation: lift-in 0.9s 0.15s ease both; }
.ornament { width: 48px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-bright)); }
.ornament:last-child { transform: scaleX(-1); }

/* Card */
.form-card { position: relative; width: min(760px, calc(100% - 32px)); margin: -120px auto 0; padding: 56px 64px 48px; background: var(--paper); border: 1px solid var(--gold-soft); box-shadow: 0 30px 80px rgba(62, 16, 28, 0.22), 0 2px 0 rgba(255, 255, 255, 0.8) inset; animation: lift-in 0.9s 0.1s ease both; }
.form-card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(201, 150, 61, 0.45); pointer-events: none; }
.form-card::after { content: ""; position: absolute; inset: 14px; border: 1px solid rgba(201, 150, 61, 0.18); pointer-events: none; }
.card-corners i { position: absolute; width: 22px; height: 22px; border-color: var(--gold); border-style: solid; border-width: 0; }
.card-corners i:nth-child(1) { top: 4px; left: 4px; border-top-width: 2px; border-left-width: 2px; }
.card-corners i:nth-child(2) { top: 4px; right: 4px; border-top-width: 2px; border-right-width: 2px; }
.card-corners i:nth-child(3) { bottom: 4px; left: 4px; border-bottom-width: 2px; border-left-width: 2px; }
.card-corners i:nth-child(4) { bottom: 4px; right: 4px; border-bottom-width: 2px; border-right-width: 2px; }

.form-intro, .success-view { text-align: center; }
.form-intro { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.section-kicker { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 14px; color: var(--gold); font-family: var(--sans); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }
.section-kicker::before, .section-kicker::after { content: "◆"; font-size: 0.5rem; }
h1, h2 { margin: 0; color: var(--maroon); font-family: var(--serif); font-weight: 700; line-height: 1.4; }
h1 { font-size: clamp(1.55rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 1.9rem); }
.intro-en { margin: 8px 0 0; color: var(--muted); font-family: var(--display-en); font-size: 1.15rem; font-style: italic; }

/* Fields */
form { position: relative; z-index: 1; }
.field-group { margin: 0; padding: 28px 0 26px; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.field-label { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; padding: 0; color: var(--maroon); cursor: pointer; }
legend.field-label { float: left; width: 100%; }
legend.field-label + * { clear: both; }
.field-label strong, .field-label small { display: block; }
.field-label strong { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; line-height: 1.35; }
.field-label small { margin-top: 2px; color: var(--muted); font-family: var(--display-en); font-size: 0.98rem; font-style: italic; }
.field-number { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: var(--serif); font-size: 0.8rem; font-weight: 600; }
.field-number + span { padding-top: 3px; }
input[type="text"], select { width: 100%; min-height: 56px; border: 1px solid rgba(101, 27, 42, 0.22); border-radius: 4px; outline: none; background: #fffefb; color: var(--ink); padding: 0 18px; font-size: 1rem; transition: border-color 0.18s ease, box-shadow 0.18s ease; }
input[type="text"]::placeholder { color: #b3a399; font-size: 0.92rem; }
select { appearance: none; cursor: pointer; padding-right: 48px; }
select:invalid { color: #9e8d84; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; top: 50%; right: 20px; width: 8px; height: 8px; margin-top: -6px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: rotate(45deg); pointer-events: none; }
input[type="text"]:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 150, 61, 0.14); }
.field-hint { margin: 12px 0 0 48px; color: var(--muted); font-size: 0.86rem; line-height: 1.8; }
.field-hint span, .photo-note span { display: block; font-family: var(--sans); font-size: 0.78rem; opacity: 0.85; }
.field-hint b { color: var(--maroon); font-weight: 600; }
.photo-hint { margin: 0 0 18px 48px; }

/* Photo slots */
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 440px; margin-left: 48px; }
.photo-slot { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; border: 1px dashed rgba(101, 27, 42, 0.32); border-radius: 4px; background: linear-gradient(160deg, #fbf4e6, #fffdf8 60%, #f6ead4); cursor: pointer; transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease; }
.photo-slot:hover, .photo-slot:focus-within { border-color: var(--gold); box-shadow: 0 10px 26px rgba(101, 27, 42, 0.12); transform: translateY(-2px); }
.photo-slot:focus-within { box-shadow: 0 0 0 4px rgba(201, 150, 61, 0.2); }
.photo-slot.invalid { border-color: var(--error); border-style: solid; }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 12px; text-align: center; pointer-events: none; }
.photo-plus { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 8px; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-family: var(--sans); font-size: 1.6rem; font-weight: 300; line-height: 1; background: rgba(255, 255, 255, 0.7); }
.photo-empty strong { color: var(--maroon); font-family: var(--serif); font-size: 1rem; }
.photo-empty small { color: var(--muted); font-family: var(--sans); font-size: 0.75rem; }
.photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.photo-change { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 10px; color: #fff; font-family: var(--sans); font-size: 0.76rem; font-weight: 500; letter-spacing: 0.04em; text-align: center; background: linear-gradient(transparent, rgba(36, 7, 15, 0.78)); opacity: 0; pointer-events: none; }
.photo-slot.filled { border-style: solid; border-color: var(--gold); }
.photo-slot.filled .photo-empty { opacity: 0; }
.photo-slot.filled .photo-change { opacity: 1; }
.photo-slot.filled.no-preview .photo-empty { opacity: 1; }
.photo-note { margin: 14px 0 0 48px; color: var(--muted); font-size: 0.78rem; line-height: 1.7; }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer + status */
.status { margin-top: 22px; border-radius: 4px; font-size: 0.9rem; line-height: 1.7; }
.status:empty { display: none; }
.status:not(:empty) { padding: 12px 16px; border: 1px solid; }
.status span { display: block; font-family: var(--sans); font-size: 0.8rem; }
.status.error { color: var(--error); border-color: rgba(154, 47, 47, 0.25); background: rgba(154, 47, 47, 0.05); }
.status.info { color: var(--maroon); border-color: var(--line); background: rgba(101, 27, 42, 0.04); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding-top: 28px; }
.privacy-note { margin: 0; max-width: 330px; color: var(--muted); font-size: 0.8rem; line-height: 1.75; }
.privacy-note span { display: block; font-family: var(--sans); font-size: 0.74rem; }
button { flex: none; border: 0; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease; }
#submit-button { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 210px; padding: 15px 34px; border-radius: 3px; color: #fff8e8; background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-deep) 100%); box-shadow: 0 12px 26px rgba(62, 16, 28, 0.28), inset 0 0 0 1px rgba(232, 197, 116, 0.45); }
#submit-button::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(232, 197, 116, 0.35); border-radius: 2px; pointer-events: none; }
.button-hi { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.button-en { color: var(--gold-bright); font-family: var(--sans); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
#submit-button:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(62, 16, 28, 0.32), inset 0 0 0 1px rgba(232, 197, 116, 0.6); }
#submit-button:disabled { cursor: wait; opacity: 0.75; transform: none; }
#submit-button.loading .button-en::after { content: " …"; }

/* Success */
.success-view { padding: 18px 0 8px; outline: none; animation: lift-in 0.6s ease both; }
.success-seal { display: grid; place-items: center; width: 74px; height: 74px; margin: 0 auto 22px; border-radius: 50%; color: var(--maroon-deep); font-size: 1.9rem; background: radial-gradient(circle at 35% 30%, #f6dc9c, var(--gold) 70%); box-shadow: 0 0 0 6px rgba(201, 150, 61, 0.15), 0 12px 30px rgba(101, 27, 42, 0.2); }
.success-ref { margin: 22px 0 26px; color: var(--muted); font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.04em; }
.success-ref b { display: block; margin-top: 4px; color: var(--maroon); font-size: 0.95rem; letter-spacing: 0.08em; }
.ghost-button { padding: 12px 22px; border: 1px solid var(--gold); border-radius: 3px; background: transparent; color: var(--maroon); font-size: 0.86rem; }
.ghost-button:hover { background: rgba(201, 150, 61, 0.1); }

.page-footer { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 44px 16px 40px; }
.page-footer img { width: 120px; height: auto; opacity: 0.9; }
.footer-rule { width: 60px; height: 1px; background: var(--gold-soft); }

@keyframes lift-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 640px) {
  .brand-logo { width: 116px; }
  .topbar-note { font-size: 0.85rem; }
  .hero { padding: 34px 16px 130px; }
  .hero::after { bottom: 96px; }
  .form-card { width: calc(100% - 24px); margin-top: -104px; padding: 40px 24px 34px; }
  .field-hint, .photo-hint, .photo-note, .photo-grid { margin-left: 0; }
  .photo-grid { gap: 12px; }
  .form-footer { flex-direction: column-reverse; align-items: stretch; gap: 18px; text-align: center; }
  .privacy-note { max-width: none; }
  #submit-button { width: 100%; }
}
