/* ==========================================================
   Shri Shyam Ji Mandir, Manauna Dham — Registration System
   Theme derived from the mandir logo:
     - Saffron/orange ring, deep red lettering,
       royal blue lettering, warm gold-cream centre.
   ========================================================== */

:root {
  --saffron: #E1611C;
  --saffron-dark: #B8420E;
  --temple-red: #C41E2A;
  --royal-blue: #1B2A6B;
  --gold: #F3D98B;
  --gold-light: #FBF2D6;
  --paper: #FFFDF6;
  --ink: #3A2712;
  --ink-soft: #6B5842;
  --success: #2E7D32;

  --font-display: 'Yatra One', 'Tiro Devanagari Hindi', serif;
  --font-hindi: 'Hind', sans-serif;
  --font-en: 'Poppins', sans-serif;
}

* { box-sizing: border-box; }

/* Force browsers to print background colors/images by default —
   without this, the saffron header & gold boxes turn invisible
   on paper because most browsers strip backgrounds when printing. */
html {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
* {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, var(--gold-light) 0%, #fff 260px, #fdf9ef 100%);
  font-family: var(--font-hindi);
  color: var(--ink);
  min-height: 100vh;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ---------------- HEADER ---------------- */

.mandir-header {
  background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-dark) 55%, var(--temple-red) 100%);
  border-bottom: 5px solid var(--temple-red);
  padding: 22px 16px 34px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.mandir-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.10) 0, transparent 45%);
  pointer-events: none;
}

.logo-badge {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0 auto 12px;
  border: 4px solid var(--gold-light);
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  background: var(--paper);
  position: relative;
  z-index: 1;
}

.logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mandir-header h1 {
  font-family: var(--font-display);
  color: #FFF6DC;
  font-size: 30px;
  margin: 4px 0 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
  line-height: 1.25;
}

.mandir-header .en-name {
  color: #FFE9BE;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}

.mandir-header .tagline {
  display: inline-block;
  background: rgba(0,0,0,0.18);
  color: var(--gold-light);
  font-family: var(--font-hindi);
  font-size: 14px;
  padding: 4px 14px;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}

.visitor-counter {
  margin-top: 10px;
  display: inline-block;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  color: #FFF6DC;
  font-family: var(--font-hindi);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}

.visitor-counter b { color: #FFFDF0; font-family: var(--font-en); }
.visitor-counter .vc-sep { opacity: 0.6; margin: 0 4px; }

/* ---------------- TORAN BUNTING STRIP ----------------
   Small triangular pennants like garlands hung across a
   temple entrance — alternating saffron / blue.        */

.toran {
  height: 20px;
  display: flex;
  width: 100%;
  overflow: hidden;
}

.toran span {
  flex: 1 0 26px;
  height: 20px;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.toran span:nth-child(4n+1) { background: var(--temple-red); }
.toran span:nth-child(4n+2) { background: var(--royal-blue); }
.toran span:nth-child(4n+3) { background: var(--saffron); }
.toran span:nth-child(4n)   { background: var(--royal-blue); }

/* ---------------- CARD / FORM ---------------- */

.card {
  background: var(--paper);
  border: 1px solid #EFDFB8;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(90, 50, 10, 0.10);
  margin-top: -14px;
  position: relative;
  z-index: 2;
  padding: 26px 20px 24px;
}

.blessing-line {
  text-align: center;
  color: var(--temple-red);
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0 0 4px;
}

.sub-line {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13.5px;
  margin: 0 0 20px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--royal-blue);
  margin-bottom: 6px;
}

.field label .en {
  font-family: var(--font-en);
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 12px;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E6D6AE;
  border-radius: 9px;
  font-size: 15px;
  font-family: var(--font-hindi);
  background: #FFFEFB;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}

.field select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #E6D6AE;
  border-radius: 9px;
  font-size: 15px;
  font-family: var(--font-hindi);
  background: #FFFEFB;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='%23E1611C' d='M5.5 7.5l4.5 4.5 4.5-4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}

.field select:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(225, 97, 28, 0.15);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(225, 97, 28, 0.15);
}

.field textarea { resize: vertical; min-height: 72px; }

.error-box {
  background: #FDECEC;
  border: 1px solid #F3B7B7;
  color: #A02A2A;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.error-box ul { margin: 4px 0 0; padding-left: 18px; }

.btn-submit {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--saffron), var(--temple-red));
  color: #fff;
  font-family: var(--font-hindi);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(196, 30, 42, 0.30);
  transition: transform .12s, box-shadow .12s;
}

.btn-submit:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(196,30,42,0.30); }

.btn-submit .en {
  display: block;
  font-family: var(--font-en);
  font-size: 11.5px;
  font-weight: 400;
  opacity: 0.9;
  margin-top: 2px;
}

.footer-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 18px;
  line-height: 1.6;
}

.om-divider {
  text-align: center;
  color: var(--saffron-dark);
  font-size: 20px;
  margin: 14px 0;
  opacity: 0.8;
}

/* ---------------- RECEIPT PAGE ---------------- */

.receipt-card {
  background: var(--paper);
  border: 3px solid var(--saffron);
  border-radius: 14px;
  margin-top: -14px;
  position: relative;
  z-index: 2;
  padding: 30px 22px 24px;
  overflow: hidden;
}

/* thin dashed inner border for a certificate feel */
.receipt-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1.5px dashed var(--gold);
  border-radius: 9px;
  pointer-events: none;
}

.ribbon-top {
  text-align: center;
  font-family: var(--font-display);
  color: var(--royal-blue);
  font-size: 15px;
  letter-spacing: 0.12em;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}

/* Om mark, subtle, top-left corner */
.om-corner {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 22px;
  color: var(--saffron-dark);
  opacity: 0.5;
  z-index: 1;
}

/* Paisley / mango motif in bottom corners — classic Indian
   temple border motif, drawn once as an inline SVG data-uri. */
.corner-motif {
  position: absolute;
  width: 30px;
  height: 30px;
  opacity: 0.55;
  z-index: 1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 60'%3E%3Cpath d='M8,52 C6,28 18,10 38,12 C52,14 50,28 38,30 C48,32 48,44 36,46 C24,50 10,50 8,52 Z' fill='%23E1611C'/%3E%3C/svg%3E");
}
.corner-motif.bl { bottom: 12px; left: 12px; }
.corner-motif.br { bottom: 12px; right: 12px; transform: scaleX(-1); }

/* "Verified" ink-stamp badge, top-right corner */
.verified-stamp {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid var(--temple-red);
  outline: 1px solid var(--temple-red);
  outline-offset: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-12deg);
  color: var(--temple-red);
  font-family: var(--font-hindi);
  font-weight: 700;
  font-size: 10.5px;
  line-height: 1.3;
  opacity: 0.92;
  z-index: 1;
}

.verified-stamp .tick { font-size: 15px; display: block; margin-bottom: 1px; }

.receipt-title {
  text-align: center;
  font-family: var(--font-display);
  color: var(--temple-red);
  font-size: 24px;
  margin: 0 0 2px;
}

.receipt-title .en {
  display: block;
  font-family: var(--font-en);
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.success-banner {
  background: #EAF6EA;
  border: 1px solid #B6DFB8;
  color: var(--success);
  text-align: center;
  padding: 10px;
  border-radius: 9px;
  font-size: 14.5px;
  margin: 16px 0;
}

.regno-box {
  text-align: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: 1.5px dashed var(--saffron-dark);
  border-radius: 10px;
  padding: 12px;
  margin: 16px 0 20px;
}

.regno-box .label {
  font-size: 12px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.regno-box .value {
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 700;
  color: var(--temple-red);
  letter-spacing: 0.04em;
}

table.details {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

table.details tr { border-bottom: 1px solid #F0E4C4; }
table.details tr:last-child { border-bottom: none; }

table.details td {
  padding: 10px 4px;
  font-size: 14.5px;
  vertical-align: top;
}

table.details td.k {
  color: var(--royal-blue);
  font-weight: 600;
  width: 42%;
}

table.details td.v { color: var(--ink); }

.blessing-box {
  margin-top: 18px;
  text-align: center;
  background: #FFF7E4;
  border: 1px solid #F0DFA8;
  border-radius: 10px;
  padding: 14px 16px;
  color: var(--temple-red);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.6;
}

.action-row {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.btn-print, .btn-new {
  flex: 1;
  text-align: center;
  padding: 13px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.btn-print {
  background: linear-gradient(135deg, var(--saffron), var(--temple-red));
  color: #fff;
}

.btn-new {
  background: #fff;
  color: var(--royal-blue);
  border: 1.5px solid var(--royal-blue);
}

.timestamp {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* ---------------- PRINT STYLES ---------------- */

@media print {
  @page { size: A5 portrait; margin: 6mm; }

  body { background: #fff !important; font-size: 12px; }
  .no-print { display: none !important; }
  .wrap { max-width: 100%; padding: 0; }

  .mandir-header {
    padding: 8px 8px 14px;
    background: linear-gradient(135deg, #E1611C 0%, #B8420E 55%, #C41E2A 100%) !important;
  }
  .logo-badge { width: 56px; height: 56px; margin-bottom: 6px; }
  .mandir-header h1 { font-size: 16px; margin: 2px 0 1px; }
  .mandir-header .en-name { font-size: 9px; }
  .mandir-header .tagline { font-size: 10px; padding: 2px 10px; }

  .toran { height: 8px; }
  .toran span { height: 8px; }

  .receipt-card {
    border-width: 1.5px;
    margin-top: -8px;
    padding: 16px 12px 12px;
    box-shadow: none;
  }
  .receipt-card::before { inset: 5px; }

  .ribbon-top { font-size: 11px; margin-bottom: 3px; }
  .receipt-title { font-size: 16px; margin-bottom: 6px; }
  .receipt-title .en { font-size: 8.5px; }

  .success-banner { padding: 6px; font-size: 10.5px; margin: 8px 0; }

  .regno-box { padding: 8px; margin: 8px 0 10px; }
  .regno-box .label { font-size: 8.5px; }
  .regno-box .value { font-size: 18px; }

  table.details td { padding: 5px 2px; font-size: 10.5px; }

  .blessing-box { margin-top: 10px; padding: 8px 10px; font-size: 11px; }

  .timestamp { font-size: 9px; margin-top: 8px; }

  .verified-stamp { width: 52px; height: 52px; font-size: 7.5px; top: 8px; right: 8px; }
  .verified-stamp .tick { font-size: 11px; }
  .corner-motif { width: 20px; height: 20px; }
  .om-corner { font-size: 15px; top: 8px; left: 10px; }
}

/* ---------------- RESPONSIVE ---------------- */

@media (max-width: 480px) {
  .mandir-header h1 { font-size: 24px; }
  .logo-badge { width: 88px; height: 88px; }
  .card, .receipt-card { padding: 20px 14px; border-radius: 12px; }
  .regno-box .value { font-size: 22px; }
  .action-row { flex-direction: column; }
}
