@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
  --saffron: #e8590c;
  --saffron-d: #c2410c;
  --maroon: #7a1f1f;
  --bg: #fff8f1;
  --card: #ffffff;
  --line: #f1d9c4;
  --text: #2b1b12;
  --muted: #6e584b;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Noto Sans Devanagari', 'Poppins', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
}
.font-en, .en-num { font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif; }
.hidden { display: none !important; }

/* Top Header & Single-Row Nav with Social Icons */
.topbar {
  background: #ffffff;
  border-bottom: 3px solid var(--saffron);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.topbar-img {
  display: block;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  height: auto;
}
.nav-strip {
  background: #fffaf5;
  border-bottom: 1px solid var(--line);
}
.nav-strip-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 9px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.nav-left-group,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.nav-brand {
  font-weight: 700;
  color: var(--maroon);
  font-size: 15px;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--saffron);
  color: var(--saffron-d);
  background: #fff;
  transition: all 0.15s ease;
}
.nav-link:hover { background: #fff1e6; }
.nav-link.primary {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  background: var(--maroon);
  border-color: var(--maroon);
  color: #fff;
}
.nav-link.primary:hover { background: #5c1515; }

/* Center Social Media Icons */
.nav-social-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-social-link:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}
.nav-social-link svg {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}
.nav-social-link.youtube { background-color: #FF0000; }
.nav-social-link.instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af, #515bd4); }
.nav-social-link.facebook { background-color: #1877F2; }
.nav-social-link.whatsapp { background-color: #25D366; }

@media (max-width: 540px) {
  .nav-strip-inner {
    padding: 8px 10px;
    gap: 5px;
  }
  .nav-link {
    font-size: 12px;
    padding: 6px 9px;
  }
  .nav-social-group {
    gap: 5px;
  }
  .nav-social-link {
    width: 24px;
    height: 24px;
  }
  .nav-social-link svg {
    width: 13px;
    height: 13px;
  }
}

/* Main Wrap */
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 14px 36px; }
.page-title {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  text-align: center;
  color: var(--maroon);
  margin: 8px 0 4px;
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 700;
}
.page-sub {
  font-family: 'Noto Sans Devanagari', sans-serif;
  text-align: center;
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 14.5px;
}
.req { color: #c80000; font-weight: 700; }

/* Sequential Section Cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(232, 89, 12, 0.06);
  transition: opacity 0.2s ease;
}
.card.locked-card {
  opacity: 0.65;
  background: #fcf9f6;
}
.card-title {
  font-family: 'Poppins', 'Noto Sans Devanagari', sans-serif;
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 700;
  color: var(--saffron-d);
  border-left: 5px solid var(--saffron);
  padding-left: 10px;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; position: relative; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-weight: 600;
  font-size: 14px;
}
input, select, textarea {
  font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
  font-size: 14.5px;
  padding: 10px 12px;
  border: 1px solid #d9c3b0;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
input[type="date"] {
  min-height: 44px;
  line-height: 1.3;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--saffron);
  border-color: var(--saffron);
}
input.invalid, select.invalid, textarea.invalid {
  border-color: #c80000;
  background: #fff5f5;
}
.hint {
  font-family: 'Noto Sans Devanagari', sans-serif;
  font-size: 12.5px;
  color: var(--muted);
}

/* Down arrow on all 3 location fields: State, District, Taluka */
#state,
#districtSearch,
#talukaSearch {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%232b1b12' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
#districtSearch,
#talukaSearch {
  cursor: pointer;
}

/* Searchable Dropdown */
.search-dropdown-box { position: relative; }
.dropdown-menu-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1.5px solid var(--saffron);
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.14);
  z-index: 40;
  margin-top: 3px;
}
.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #f6ebe0;
}
.dropdown-item:last-child { border-bottom: 0; }
.dropdown-item:hover { background: #fff1e6; color: var(--maroon); font-weight: 600; }

/* Buttons & Alerts */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--saffron);
  color: #fff;
  border: 0;
  border-radius: 11px;
  padding: 13px 20px;
  font-family: 'Noto Sans Devanagari', 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.12s ease;
}
.btn:hover { background: var(--saffron-d); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 9px; }
.btn.ghost {
  background: #fff;
  color: var(--saffron-d);
  border: 1.5px solid var(--saffron);
}
.btn.ghost:hover { background: #fff1e6; }

/* Phase Action Buttons Alignment */
.phase-nav-actions,
#phaseSec1 > div:last-child,
#phaseSec2 > div:last-child,
#phaseSec3 > div:last-child {
  margin-top: 18px !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#phaseSec1 > div:last-child {
  justify-content: flex-end;
}
.phase-nav-actions .btn,
#phaseSec1 > div:last-child .btn,
#phaseSec2 > div:last-child .btn,
#phaseSec3 > div:last-child .btn {
  margin: 0;
  min-height: 42px;
}

.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.previews img {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.msg {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-weight: 600;
  font-size: 14.5px;
}
.msg.err { background: #fff0f0; color: #991b1b; border: 1px solid #fca5a5; }
.msg.info { background: #fff7e6; color: #7a4a00; border: 1px solid #fcd34d; }

.progress {
  height: 11px;
  background: #f1e2d4;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
#progressBar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--saffron), var(--maroon));
  transition: width 0.25s ease;
}

/* Modal Popup after Form Submit */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 14px;
}
.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  padding: 24px 20px;
  text-align: center;
  border: 2px solid var(--saffron);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Centered Bottom Footer Banner Image */
.bottom-banner-wrap {
  width: 100%;
  max-width: 960px;
  margin: 12px auto 24px;
  padding: 0 14px;
  text-align: center;
}
.bottom-banner-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(122, 31, 31, 0.08);
}

/* Right-side Scroll Up Arrow Button */
.scroll-up-btn {
  position: fixed;
  right: 18px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--maroon);
  color: #fff;
  border: 2px solid var(--saffron);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  z-index: 50;
}
.scroll-up-btn:hover { background: var(--saffron-d); }

/* 3-Phase Card Stepper + Bottom Progress Bar */
.phase-stepper-3 {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 6px 0 18px;
  margin-bottom: 18px;
}
.phase-stepper-3::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: #f1e2d4;
  border-radius: 999px;
}
.phase-stepper-3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  width: var(--stepper-progress, 33.33%);
  background: #f59e0b;
  border-radius: 999px;
  transition: width 0.25s ease;
}
.phase-stepper-3[data-step="2"]::after,
.phase-stepper-3:has(#phaseBtn2.active)::after,
.phase-stepper-3:has(#phaseBtn2.done):not(:has(#phaseBtn3.active)):not(:has(#phaseBtn3.done))::after {
  width: 66.66%;
}
.phase-stepper-3[data-step="3"]::after,
.phase-stepper-3:has(#phaseBtn3.active)::after,
.phase-stepper-3:has(#phaseBtn3.done)::after {
  width: 100%;
}
.phase-card-btn {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 4px 8px !important;
  text-align: center;
  cursor: pointer;
  font-family: 'Noto Sans Devanagari', sans-serif;
  transition: transform 0.15s ease, opacity 0.2s ease;
}
.phase-card-btn .phase-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 16px;
  background: #ede2d6;
  color: #6e584b;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}
.phase-card-btn .phase-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--maroon);
}
.phase-card-btn.active .phase-circle {
  background: #ffffff;
  color: var(--maroon);
  border: 2.5px solid var(--maroon);
}
.phase-card-btn.done .phase-circle {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}
.phase-card-btn.locked {
  opacity: 0.85;
  cursor: not-allowed;
}
.phase-card-btn.locked .phase-label {
  color: #6e584b;
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .wrap { padding: 14px 10px 28px; }
  .card { padding: 14px; }
  .bottom-banner-wrap {
    padding: 0 10px;
    margin: 8px auto 20px;
  }
  .phase-stepper-3 {
    gap: 6px;
    padding: 4px 0 16px;
  }
  .phase-card-btn .phase-circle {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .phase-card-btn .phase-label {
    font-size: 13px;
  }
  .phase-nav-actions,
  #phaseSec2 > div:last-child,
  #phaseSec3 > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  #phaseSec1 > div:last-child {
    display: flex;
    justify-content: stretch;
  }
  .phase-nav-actions .btn,
  #phaseSec1 > div:last-child .btn,
  #phaseSec2 > div:last-child .btn,
  #phaseSec3 > div:last-child .btn {
    width: 100%;
    padding: 10px 8px !important;
    font-size: 12.5px !important;
    min-height: 44px;
    line-height: 1.25;
    text-align: center;
  }
}
