/* =========================================================
   SWADESHI APNAO — POLISHED LANDING STYLES (FINAL)
   Fonts: Sora (EN), Anek Devanagari (HI)
   ========================================================= */

/* ===== Tokens & Fonts ===== */
:root {
  --font-sans: 'Sora', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-hi: 'Anek Devanagari', 'Sora', sans-serif;

  /* India palette */
  --saffron: #ff7a00;
  --green: #1aa05a;
  --peacock: #0a93b3;

  /* UI tokens */
  --ink: #0e1115;
  --paper: #ffffff;
  --line: #e6edf2;
}

/* ===== Base & Global Styles ===== */
html {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: inherit;
}


body {
  font-family: var(--font-sans);
  color: var(--ink);
}

/* Force Hindi lines/headings to use Anek Devanagari */
.hi,
:lang(hi),
[lang="hi"] {
  font-family: var(--font-hi);
}

/* ===== Background (Atmanirbhar-inspired) ===== */
body.theme-vibrant {
  background:
    radial-gradient(1200px 600px at 0% -10%, color-mix(in oklab, var(--saffron) 18%, transparent) 0, transparent 60%),
    radial-gradient(1000px 600px at 110% 0%, color-mix(in oklab, var(--green) 18%, transparent) 0, transparent 60%),
    radial-gradient(900px 520px at 50% 120%, color-mix(in oklab, var(--peacock) 16%, transparent) 0, transparent 65%),
    linear-gradient(180deg, #ffffff, #f7faf9 40%, #fbfdff);
}

/* subtle grain so it doesn’t feel flat */
body.theme-vibrant::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(0, 0, 0, .03) 0 1px, transparent 1px),
    radial-gradient(1px 1px at 80% 70%, rgba(0, 0, 0, .025) 0 1px, transparent 1px);
  background-size: 120px 120px, 160px 160px;
  opacity: .45;
}

/* tricolour ribbon */
.tri-ribbon {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 6px;
  background: linear-gradient(90deg, var(--saffron) 0 33.33%, #ffffff 33.33% 66.66%, var(--green) 66.66% 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .05);
}

/* ===== Layout ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}

/* ===== Hero (left) panel ===== */
.intro.glass {
  padding: 18px 18px 14px;
  border: 1px solid rgba(0, 0, 0, .06);
  background: linear-gradient(180deg, rgba(255, 255, 255, .78), rgba(255, 255, 255, .65));
  backdrop-filter: blur(8px);
}

.intro h2 {
  font-size: 1.6rem;
  margin: 4px 0 10px;
  line-height: 1.25;
  background: linear-gradient(90deg, #0a93b3, #18bb86);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.intro .muted {
  color: #38424a;
}

.gradient-bharat { text-shadow: 0 0 0.01px rgba(0,0,0,.3); }
.btn:focus-visible, a:focus-visible { outline: 3px solid #0ea5b7; outline-offset: 2px; }

.intro .why {
  margin: 16px 0 10px;
  display: grid;
  gap: 8px;
}

.intro .why .item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid #e8eef3;
  border-radius: 14px;
  padding: 10px 12px;
}

.item .ico {
  font-size: 18px;
}

.cert-preview {
  margin: 14px 0 2px;
  background: #fff;
  border: 1px solid #e8eef3;
  padding: 10px;
  border-radius: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.cert-preview img {
  width: 110px;
  height: auto;
  border-radius: 10px;
  border: 1px solid #e1e7ee;
}

.cert-preview .txt {
  font-size: .95rem;
  color: #202930;
}

#liveCert {
  margin: 8px 0 0;
}

/* ===== Form card (right) ===== */
.form-card.glass {
  padding: 18px 18px 14px;
  border: 1px solid rgba(0, 0, 0, .06);
  background: linear-gradient(180deg, rgba(255, 255, 255, .84), rgba(255, 255, 255, .75));
  box-shadow: 0 10px 24px rgba(18, 64, 57, .06);
}

.form-card .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Ensure form elements are full-width and contained */
.form-card .grid label {
  display: block;
  width: 100%;
}

.form-card .grid input,
.form-card .grid .btn,
.form-card .grid .link-btn {
  display: block;
  width: 100%;
  max-width: 100%;
}

/* ===== Stepper ===== */
.stepper {
  display: flex;
  gap: 10px;
  margin: 0 0 14px
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e5eef2;
  background: #fff
}

.step .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  border: 1px solid #e5eef2;
  background: #fff;
  color: #0e1115
}

.step .txt {
  font-weight: 700;
  color: #0e1115;
  font-size: .9rem
}

.step.active {
  border-color: #0a93b3;
  box-shadow: 0 0 0 3px rgba(10, 147, 179, .12)
}

.step.active .num {
  background: #0a93b3;
  color: #fff;
  border-color: transparent
}

.step.done .num {
  background: linear-gradient(90deg, #18bb86, #0a93b3);
  color: #fff;
  border-color: transparent
}

/* ===== Labels & Inputs ===== */
label>span {
  font-weight: 700;
  color: #0a1117;
  margin-bottom: 6px;
  display: block;
  font-size: .95rem
}

input[type="text"],
input[type="tel"],
input[type="email"] {
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 8px 12px;
  font-size: .95rem;
  color: #0e1115;
}

input:focus {
  outline: none;
  border-color: #18bb86;
  box-shadow: 0 0 0 3px rgba(24, 187, 134, .14);
}

input[aria-invalid="true"] {
  border-color: #f23d4f;
  box-shadow: 0 0 0 3px rgba(242, 61, 79, .12);
}

/* ===== Buttons ===== */
.btn,
button#submitBtn {
  background: linear-gradient(90deg, #18bb86, #0a93b3);
  color: #ffffff;
  border: 0;
  border-radius: 12px;
  padding: 10px 10px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .2px;
  box-shadow: 0 10px 22px rgba(15, 176, 110, .25);
  font-size: .95rem;
}

.btn[disabled],
button[disabled] {
  opacity: .65;
  cursor: not-allowed
}

#submitBtn {
  width: 100%;
  padding: 12px 16px;
  font-size: .98rem;
}

.link-btn {
  background: transparent;
  border: 0;
  color: #0a93b3;
  font-weight: 800;
  cursor: pointer;
  padding: 0
}

.link-btn[disabled] {
  opacity: .45;
  cursor: not-allowed
}

/* ===== Phone & OTP Fields ===== */
#phoneRow,
#otpRow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#otpRow {
  margin-top: 6px;
}

#sendOtpBtn,
#verifyOtpBtn {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  font-size: .95rem;
}

#otpCode {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  letter-spacing: 2px;
  text-align: center;
  font-weight: 800;
}

#otpRow[hidden] { display: none; }  /* no !important */

/* small readability */
.status { margin-left: 6px; }


/* ===== Hints & Statuses ===== */
.hint {
  color: #5a6872;
  font-size: .85rem;
}

.status {
  font-size: .86rem;
}

.status--ok {
  color: #18bb86;
  font-weight: 800;
}

.status--err {
  color: #f23d4f;
  font-weight: 800;
}
/* In css/style.css */

.status--pending {
  color: var(--saffron); /* Uses the orange from your color palette */
  font-weight: 700;
}

/* ===== Safety Line ===== */
.safe-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: #36424a;
  font-weight: 700;
  font-size: .92rem
}

.safe-line .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(90deg, #18bb86, #0a93b3)
}

/* =========================================
   ===== Responsive Styles =====
   ========================================= */

/* Tablet & Small Desktops (<= 900px) */
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .intro.glass,
  .form-card.glass {
    padding: 14px;
  }

  .cert-preview {
    display: none;
    /* Hide heavy preview on smaller screens */
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"],
  #sendOtpBtn,
  #verifyOtpBtn {
    height: 42px;
  }
}

/* Mobile Devices (<= 480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }

  .intro.glass,
  .form-card.glass {
    padding: 12px;
  }

  .form-card.glass {
    overflow: hidden;
    /* Prevents shadow bleed */
  }

  .form-card .grid {
    gap: 10px;
  }

  label>span {
    font-size: .9rem;
    margin-bottom: 6px;
  }

  input[type="text"],
  input[type="tel"],
  input[type="email"] {
    height: 40px;
    padding: 8px 10px;
    font-size: .92rem;
    border-radius: 10px;
  }

  #sendOtpBtn,
  #verifyOtpBtn {
    height: 42px;
    padding: 10px 12px;
    font-size: .92rem;
    border-radius: 10px;
  }

  #otpCode {
    height: 38px;
    max-width: 240px;
    border-radius: 10px;
  }

  .btn,
  button#submitBtn {
    padding: 10px 12px;
    font-size: .94rem;
    border-radius: 10px;
  }

  /* Make stepper scrollable on small screens */
  .stepper {
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  .stepper::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }

  .step {
    padding: 6px 10px
  }

  .step .num {
    width: 20px;
    height: 20px;
    font-size: .8rem
  }

  .step .txt {
    font-size: .88rem
  }

  .hint {
    font-size: .82rem
  }

  .status {
    font-size: .84rem
  }
}
/* Certificate render surface */
#certDom{
  position: relative;
  width: 1100px;   /* 11x8.5 in at 100px/in base, we scale in JS */
  height: 850px;
  opacity: 0;            /* keep hidden after render */
  pointer-events: none;
  user-select: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#certDom { background-repeat:no-repeat; background-size:cover; background-position:center; }

/* (Optional) text blocks if not already inline on thankyou.html */
#certNo{
  position:absolute; top:28px; right:36px; text-align:right;
  font:700 20px "Anek Devanagari",sans-serif; color:#444; letter-spacing:.2px;
}
#certName{
  position:absolute; top:300px; left:60px; right:60px; text-align:center;
  font:700 52px "Anek Devanagari",sans-serif; color:#222; line-height:1.15;
}
#pledge{
  position:absolute; top:400px; left:120px; right:120px; text-align:center;
  font:500 28px "Anek Devanagari",sans-serif; color:#333; line-height:1.55;
}
/* Certificate layout overrides */
#certName{
  top: 360px;            /* move name down */
  left: 60px; right: 60px;
  text-align: center;
  line-height: 1.12;
}

#pledge{
  top: 460px;            /* move pledge down under name */
  left: 120px; right: 120px;
  text-align: center;
  line-height: 1.5;
}

/* Slightly different vertical rhythm for Hindi text */
html[lang="hi"] #certName { top: 345px; }
html[lang="hi"] #pledge   { top: 445px; }

