/* ---------- Base Variables & Reset ---------- */
:root {
  --red: #a80a0a;       
  --gold: #f3b32a;      
  --navy: #0b2f63;      
  --bg: #fdfbf5;        
  --line: #e0e0e0;
  --green: #138a3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans Devanagari', system-ui, sans-serif;
  background: var(--bg);
  color: var(--navy);
}

/* ---------- Header ---------- */
header {
  background: #ffffff;
  border-bottom: 3px solid var(--gold);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

header img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: transparent;
}

header > div {
  text-align: left;
}

header h1 {
  margin: 0;
  color: var(--red);
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 800;
}

header p {
  margin: 2px 0 6px;
  color: var(--navy);
  font-weight: 600;
  font-size: clamp(12px, 2.5vw, 15px);
}

header small {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* ---------- Main Container & Cards ---------- */
main {
  max-width: 860px;
  margin: 30px auto;
  padding: 0 14px 40px;
}

.card {
  background: #ffffff;
  border: 1px solid var(--gold); 
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.card > h2 {
  margin: 0;
  background: #ffffff;
  color: var(--red);
  font-size: 22px;
  padding: 20px 20px 10px;
  text-align: center;
}

.body {
  padding: 10px 24px 24px;
}

/* ---------- Step 0: Agreement & Watermark ---------- */
.watermark-card {
  position: relative;
  z-index: 1;
}

.watermark-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('logo.png') center/contain no-repeat;
  opacity: 0.06; 
  z-index: -1;
}

.agreement-content {
  font-size: 15.5px;
  line-height: 1.6;
  color: #333;
}

.agreement-content ul {
  padding-left: 24px;
  margin-bottom: 22px;
}

.agreement-content li {
  margin-bottom: 12px;
}

.consent-box {
  background: #fffdf5;
  border: 1px solid var(--gold);
  padding: 14px 18px;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 18px;
}

.consent-box input {
  width: 22px;
  height: 22px;
  accent-color: #e65c00;
  margin-top: 1px;
  cursor: pointer;
  flex: none;
}

.consent-box label {
  cursor: pointer;
  margin: 0;
  color: var(--navy);
  font-size: 14.5px;
  line-height: 1.5;
}

#btn_start:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* ---------- Forms & Inputs ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}

.full {
  grid-column: 1 / -1;
}

@media(max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 6px;
}

label b {
  color: var(--red);
}

input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 6px; 
  background: #ffffff;
  color: var(--navy);
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

.err {
  color: var(--red);
  font-size: 12.5px;
  margin-top: 4px;
  min-height: 0;
}

.invalid {
  border-color: var(--red);
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--red);
}

/* ---------- Buttons & Actions ---------- */
button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 6px;
  padding: 14px 30px;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  transition: background 0.2s;
}

button:hover {
  background: #870707;
}

button.sec {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
}

button.sec:hover {
  background: #f0f4f8;
}

button:disabled {
  opacity: .6;
  cursor: wait;
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ---------- Alerts & Stepper ---------- */
.alert {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-weight: 600;
  text-align: center;
}

.alert.bad {
  background: #fdecec;
  color: #8f0000;
  border: 1px solid #f3b4b4;
}

.alert.ok {
  background: #e7f6ec;
  color: var(--green);
  border: 1px solid #b6e2c5;
}

.steps {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 700;
}

.steps span {
  padding: 6px 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #ddd;
  color: #666;
}

.steps span.on {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.hide {
  display: none !important;
}

/* ---------- Review & Fee Details ---------- */
.review {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px 16px;
  font-size: 15px;
}

.review dt {
  font-weight: 700;
  color: var(--navy);
}

.review dd {
  margin: 0;
  word-break: break-word;
  color: #333;
}

@media(max-width: 640px) {
  .review {
    grid-template-columns: 120px 1fr;
  }
}

.fee {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fffdf5;
  border: 1px dashed var(--gold);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 20px 0;
  font-weight: 800;
  color: var(--red);
  font-size: 20px;
}

/* ---------- Canvas & Preview Overlays ---------- */
.preview-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.preview-inner { transform-origin: top left; width: 1100px; }
#capture { position: fixed; left: -20000px; top: 0; }

/* ---------- Receipt Output Layout ---------- */
.rc { width: 1100px; height: 620px; background: #fff; border: 3px solid var(--red); position: relative; font-family: 'Noto Sans Devanagari', sans-serif; color: var(--navy); overflow: hidden; }
.rc-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 26px 0; }
.rc-head img { width: 92px; height: 92px; object-fit: contain; }
.rc-mid { text-align: center; flex: 1; }
.rc-mid h1 { margin: 0; color: var(--red); font-size: 42px; font-weight: 800; line-height: 1.25; }
.rc-mid p { margin: 2px 0 0; font-size: 17px; font-weight: 700; }
.rc-reg { text-align: right; font-size: 14px; width: 210px; }
.rc-reg b { display: block; margin-bottom: 6px; }
.rc-reg span { color: #555; }
.rc-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 26px 4px; }
.rc-bar div { font-size: 14px; font-weight: 700; }
.rc-badge { background: var(--red); color: #fff; font-size: 28px; font-weight: 800; padding: 4px 52px; border-radius: 10px; border: 2px solid var(--gold); }
.rc-cols { display: flex; gap: 22px; padding: 8px 26px 0; }
.rc-box { border: 1px solid var(--navy); border-radius: 12px; background: #fdfdfd; overflow: hidden; }
.rc-box h3 { margin: 0; background: var(--navy); color: #fff; font-size: 16px; padding: 6px 16px; }
.rc-left { width: 560px; }
.rc-right { width: 470px; display: flex; flex-direction: column; gap: 10px; }
.rc-row { display: flex; padding: 4px 16px; font-size: 13.5px; line-height: 1.4; border-bottom: 1px solid #eee; }
.rc-row:last-child { border-bottom: none; }
.rc-row b { width: 150px; flex: none; }
.rc-row span { color: #222; flex: 1; word-break: break-word; }
.rc-ok { background: #e7f6ec; border: 1.5px solid #6fc48c; color: var(--green); border-radius: 8px; text-align: center; font-weight: 800; font-size: 18px; padding: 8px; }
.rc-decl p { margin: 0; padding: 8px 16px; font-size: 13px; line-height: 1.5; color: #333; }
.rc-sign { position: absolute; left: 0; right: 0; bottom: 36px; display: flex; justify-content: space-between; padding: 0 50px; font-size: 13px; }
.rc-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 30px; background: var(--red); color: #fff; text-align: center; font-weight: 700; font-size: 14px; line-height: 30px; }