/* ============================================================
   Marriage Registration Portal — Demo styles
   Consistent color scheme + typography across all pages.
   ============================================================ */

:root {
  --navy: #1f3a5f;
  --navy-dark: #16293f;
  --navy-light: #2f5688;
  --gold: #c9a227;
  --gold-soft: #e8d9a8;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d2430;
  --muted: #667085;
  --line: #e3e1d9;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --success: #1e7e50;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(22, 41, 63, 0.10);
  --maxw: 880px;
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; color: var(--navy); }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 0 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
a { color: var(--navy-light); }

/* ---------- Layout ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--gold);
}
.site-header .bar {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.crest {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--font-serif);
  font-weight: 700;
}
.site-header .title { font-family: var(--font-serif); font-size: 1.05rem; letter-spacing: .3px; }
.site-header .title small { display: block; font-family: var(--font-sans); font-size: .72rem; opacity: .8; letter-spacing: .5px; text-transform: uppercase; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card + .card { margin-top: 22px; }

/* ---------- Progress indicator ---------- */
.progress {
  max-width: var(--maxw);
  margin: 22px auto 0;
  padding: 0 20px;
}
.progress ol {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0; padding: 0;
}
.progress li {
  flex: 1;
  text-align: center;
  font-size: .74rem;
  color: var(--muted);
  padding-top: 10px;
  border-top: 4px solid var(--line);
  letter-spacing: .3px;
}
.progress li.done { border-top-color: var(--gold); color: var(--navy); }
.progress li.active { border-top-color: var(--navy); color: var(--navy); font-weight: 700; }
.progress .step-label { display: block; }
.progress .step-num { display: block; font-size: .68rem; text-transform: uppercase; opacity: .7; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-primary:disabled { background: #9fb0c4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: #f0eee7; }
.btn-gold { background: var(--gold); color: #23324a; }
.btn-gold:hover { background: #b9931f; }
.btn-block { width: 100%; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.actions .spacer { flex: 1; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.grid .field { margin-bottom: 0; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: #33404f; }
label .req { color: var(--danger); }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid #cdd3db;
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px rgba(47, 86, 136, .15);
}
textarea { resize: vertical; min-height: 70px; }
.error-text { color: var(--danger); font-size: .78rem; margin-top: 4px; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
.field.invalid .error-text { display: block; }

fieldset { border: none; padding: 0; margin: 0 0 8px; }

/* ---------- Party header with photo ---------- */
.party-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.party-photo {
  width: 68px; height: 68px; flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold-soft);
  background: #eee;
}
.party-head .role { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

/* ---------- Consent + signature ---------- */
.consent-box {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #f4f6f9;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.consent-box input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--navy); }
.consent-box label { margin: 0; font-weight: 500; font-size: .92rem; }

.sig-wrap { margin-top: 20px; opacity: .45; pointer-events: none; transition: opacity .2s ease; }
.sig-wrap.enabled { opacity: 1; pointer-events: auto; }
.sig-frame {
  width: 100%;
  min-height: 170px;
  border: 2px dashed #b9c2cf;
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, #e9ecf1 39px, #e9ecf1 40px),
    #fff;
  display: grid;
  place-items: center;
  padding: 12px;
  transition: border-color .2s ease, background .2s ease;
}
.sig-frame.has-sig {
  border-style: solid;
  border-color: var(--gold-soft);
  background: #fff;
  padding: 14px 18px;
}
.sig-placeholder { color: #9aa4b2; font-size: .9rem; font-style: italic; }
.sig-image {
  display: block;
  width: 100%;
  max-width: 360px;
  max-height: 130px;
  margin: 0 auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  animation: sigInk .5s ease both;
}
@keyframes sigInk {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.sig-hint { font-size: .78rem; color: var(--muted); margin: 6px 0 10px; }

.sig-saved {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--gold-soft);
  background: #fcfaf2;
  border-radius: 10px;
}
.sig-saved.show { display: block; }
.sig-saved .tag { color: var(--success); font-weight: 700; }

.note {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  background: #fbf7ea;
  border-radius: 4px;
  font-size: .92rem;
}

/* ---------- Mock payment (Stripe-style) ---------- */
.pay-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.pay-summary {
  background: linear-gradient(160deg, #3c93ff, #2f6fd0);
  color: #fff;
  padding: 32px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.pay-summary .merchant { font-size: .8rem; opacity: .85; letter-spacing: .5px; text-transform: uppercase; }
.pay-summary .amount { font-family: var(--font-serif); font-size: 2.4rem; margin: 6px 0 20px; }
.pay-summary .line { display: flex; justify-content: space-between; font-size: .9rem; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.25); }
.pay-form-side { background: #fff; padding: 32px; border-radius: 0 var(--radius) var(--radius) 0; border: 1px solid var(--line); }
.card-input-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brandline { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); margin-top: 18px; }
.brandline::before { content: "🔒"; }

.processing {
  display: none;
  text-align: center;
  padding: 30px 0 10px;
}
.processing.show { display: block; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid #d7e3f5;
  border-top-color: #3c93ff;
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Failure page ---------- */
.result { text-align: center; padding: 20px 0; }
.result .icon {
  width: 72px; height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 2rem;
  background: var(--danger-bg);
  color: var(--danger);
  border: 2px solid #f1b7b0;
}
.result h1 { color: var(--danger); }
.result .sub { color: var(--muted); max-width: 460px; margin: 0 auto 24px; }

/* ---------- Hero (landing) ---------- */
.hero { text-align: center; padding: 20px 0 8px; }
.hero .kicker { text-transform: uppercase; letter-spacing: 2px; font-size: .75rem; color: var(--gold); font-weight: 700; }
.hero h1 { font-size: 2.3rem; margin: 10px 0; }
.hero p { max-width: 560px; margin: 0 auto 24px; color: #45505f; }
.hero-photos { display: flex; justify-content: center; gap: 14px; margin: 22px 0 6px; }
.hero-photos img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: var(--shadow); }
.hero-photos .amp { align-self: center; font-family: var(--font-serif); font-size: 1.6rem; color: var(--gold); }

.info-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 26px; }
.info-list div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.info-list h3 { margin-bottom: 4px; }
.info-list p { font-size: .85rem; color: var(--muted); margin: 0; }

/* ---------- Landing animations ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(.6); }
  70%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@keyframes ampPulse {
  0%, 100% { transform: scale(1); color: var(--gold); }
  50%      { transform: scale(1.18); color: #e0b53a; }
}
@keyframes sheen {
  from { background-position: -140% 0; }
  to   { background-position: 240% 0; }
}

/* run only on the landing page */
.landing .hero > *,
.landing .info-list > div { opacity: 0; animation: riseIn .7s ease forwards; }
.landing .hero .kicker      { animation-delay: .05s; }
.landing .hero h1           { animation-delay: .16s; }
.landing .hero p            { animation-delay: .28s; }
.landing .hero-photos       { animation-delay: .40s; }
.landing .hero .actions     { animation-delay: .60s; }
.landing .info-list > div:nth-child(1) { animation-delay: .74s; }
.landing .info-list > div:nth-child(2) { animation-delay: .84s; }
.landing .info-list > div:nth-child(3) { animation-delay: .94s; }

.landing .hero-photos img {
  animation: popIn .6s cubic-bezier(.2,.8,.3,1.4) both, floaty 5s ease-in-out infinite;
}
.landing .hero-photos img:first-of-type { animation-delay: .44s, 1.2s; }
.landing .hero-photos img:last-of-type  { animation-delay: .58s, 1.6s; }
.landing .hero-photos .amp { animation: ampPulse 2.6s ease-in-out infinite; animation-delay: 1s; }

.landing .hero .btn-primary {
  background-image: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: sheen 3.2s ease-in-out 1.4s infinite;
}
.landing .hero .btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  .landing .hero > *,
  .landing .info-list > div,
  .landing .hero-photos img,
  .landing .hero-photos .amp,
  .landing .hero .btn-primary { animation: none; opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  :root { --maxw: 680px; }
  main { padding: 20px 16px 48px; }
  .grid { grid-template-columns: 1fr; }
  .pay-layout { grid-template-columns: 1fr; }
  .pay-summary { border-radius: var(--radius) var(--radius) 0 0; padding: 24px; }
  .pay-form-side { border-radius: 0 0 var(--radius) var(--radius); padding: 24px; }
  .info-list { grid-template-columns: 1fr; }
  .progress { margin-top: 16px; }
  .progress li .step-label { display: none; }
  .progress li { font-size: .68rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero .kicker { font-size: .68rem; letter-spacing: 1.5px; }
  .card { padding: 20px; }
  h1 { font-size: 1.6rem; }
  .site-header .bar { padding: 12px 16px; }
  .actions { gap: 10px; }
  .actions .btn { flex: 1 1 auto; }
  .actions .spacer { display: none; }
}

@media (max-width: 420px) {
  .hero-photos img { width: 76px; height: 76px; }
  .btn { padding: 12px 18px; }
  .btn-lg { padding: 14px 22px; font-size: 1rem; }
  .card-input-row { grid-template-columns: 1fr; }
}
