/* ==========================================================================
   PRONIDHY WELFARE ORGANIZATION — CIVIC DOSSIER DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Botanical Forest & Brand Spectrum (derived directly from Pronidhy logo & banner) */
  --forest-950: #0c2617;
  --forest-900: #133c24;
  --forest-800: #1a4e2f;
  --forest-700: #23633d;
  --forest-100: #e7f0e9;

  --ivory-50: #fcfcf4;
  /* Exact corner tone of official logo image */
  --ivory-100: #f4f5ea;
  --ivory-200: #e5e8d6;
  --surface-card: #ffffff;

  --lime-brand: #8ec629;
  --lime-bright: #a6db3a;
  --lime-soft: #eef6db;

  --saffron-brand: #e87722;
  --saffron-deep: #c95f10;
  --saffron-soft: #fdf0e3;

  /* Ink & Hairlines */
  --ink-900: #142319;
  --ink-700: #2c4134;
  --ink-500: #556b5d;
  --ink-400: #728779;

  --border-subtle: #d8dfca;
  --border-strong: #9eb19c;

  /* Semantic States */
  --success: #1d7542;
  --success-soft: #e8f6ee;
  --danger: #bf3626;
  --danger-soft: #fdece9;

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", "Hind Siliguri", sans-serif;
  --font-bn: "Hind Siliguri", "Plus Jakarta Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  /* Elevation & Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-paper: 0 1px 2px rgba(19, 60, 36, 0.05), 0 10px 28px -12px rgba(19, 60, 36, 0.09);
  --shadow-lift: 0 12px 32px -10px rgba(19, 60, 36, 0.16);
  --shadow-focus: 0 0 0 3px rgba(142, 198, 41, 0.35);

  /* Layout Rhythm */
  --rail-width: clamp(320px, 28vw, 410px);
  --text-scale: 1;
}

/* Accessibility: Larger Text Mode */
body.large-text {
  --text-scale: 1.12;
}

/* Accessibility: High Contrast Mode */
body.high-contrast {
  --ivory-50: #ffffff;
  --ivory-100: #f3f5f0;
  --surface-card: #ffffff;
  --ink-900: #000000;
  --ink-700: #111111;
  --ink-500: #222222;
  --border-subtle: #3d5243;
  --border-strong: #133c24;
  --shadow-focus: 0 0 0 4px #e87722;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: calc(16px * var(--text-scale));
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-900);
  background-color: var(--ivory-50);
  background-image:
    radial-gradient(circle at 85% 8%, rgba(142, 198, 41, 0.10), transparent 36%),
    radial-gradient(circle at 65% 88%, rgba(232, 119, 34, 0.08), transparent 40%);
  line-height: 1.6;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only-input {
  position: absolute;
  inset: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 999;
  background: var(--forest-900);
  color: var(--ivory-50);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 16px;
  outline: 3px solid var(--lime-brand);
}

/* ==========================================================================
   ASYMMETRIC SPLIT LAYOUT SHELL
   ========================================================================== */

.page-shell {
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

/* ==========================================================================
   LEFT STICKY BOTANICAL MISSION & PROGRESS RAIL
   ========================================================================== */

.brand-rail {
  position: relative;
  background:
    radial-gradient(circle at 15% 10%, rgba(142, 198, 41, 0.16), transparent 45%),
    radial-gradient(circle at 90% 85%, rgba(232, 119, 34, 0.14), transparent 45%),
    linear-gradient(175deg, var(--forest-900) 0%, var(--forest-950) 100%);
  color: var(--ivory-50);
  border-right: 1px solid rgba(252, 252, 244, 0.12);
}

/* Subtle leaf-contour texture overlay */
.brand-rail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: repeating-radial-gradient(circle at 0% 100%,
      transparent 0,
      transparent 28px,
      rgba(252, 252, 244, 0.35) 29px,
      transparent 30px);
}

.rail-inner {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(252, 252, 244, 0.25) transparent;
}

/* Brand Identity Medallion */
.brand-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(252, 252, 244, 0.06);
  border: 1px solid rgba(252, 252, 244, 0.14);
  backdrop-filter: blur(8px);
}

.logo-medallion {
  flex-shrink: 0;
  width: 82px;
  padding: 8px 8px 6px;
  background: var(--ivory-50);
  border-radius: 14px;
  border: 2px solid rgba(142, 198, 41, 0.65);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.logo-medallion img {
  width: 100%;
  border-radius: 6px;
}

.brand-eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.11em;
  color: var(--lime-bright);
  margin-bottom: 2px;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--ivory-50);
}

.brand-subtitle {
  margin: 2px 0 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(252, 252, 244, 0.9);
}

.brand-tagline {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.82rem;
  color: #f9cd76;
}

/* Rail Section Containers */
.rail-section {
  border-radius: var(--radius-md);
  background: rgba(252, 252, 244, 0.055);
  border: 1px solid rgba(252, 252, 244, 0.12);
  padding: 15px 16px;
}

.rail-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: rgba(252, 252, 244, 0.68);
}

.progress-counter {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--lime-bright);
}

.progress-bar-track {
  height: 5px;
  background: rgba(252, 252, 244, 0.14);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lime-brand), var(--saffron-brand));
  border-radius: 999px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Step Tracker */
.step-tracker {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-item {
  display: grid;
  grid-template-columns: 30px 1fr 18px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.step-item.is-complete {
  background: rgba(142, 198, 41, 0.12);
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(252, 252, 244, 0.09);
  border: 1px solid rgba(252, 252, 244, 0.22);
  color: rgba(252, 252, 244, 0.85);
  transition: all 0.25s ease;
}

.step-item.is-complete .step-dot {
  background: var(--lime-brand);
  border-color: var(--lime-brand);
  color: var(--forest-950);
}

.step-copy strong {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ivory-50);
  line-height: 1.25;
}

.step-copy span {
  display: block;
  font-size: 0.73rem;
  color: rgba(252, 252, 244, 0.68);
}

.step-status {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(252, 252, 244, 0.28);
  position: relative;
}

.step-item.is-complete .step-status {
  background: var(--lime-brand);
  border-color: var(--lime-brand);
}

.step-item.is-complete .step-status::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 2px;
  width: 4px;
  height: 7.5px;
  border: solid var(--forest-950);
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}

/* Privacy / Zero Google Drive Card */
.privacy-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  background: linear-gradient(135deg, rgba(232, 119, 34, 0.16), rgba(142, 198, 41, 0.11));
  border-color: rgba(249, 205, 118, 0.35);
}

.privacy-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(252, 252, 244, 0.14);
  color: #f9cd76;
  display: grid;
  place-items: center;
}

.privacy-icon svg {
  width: 20px;
  height: 20px;
}

.privacy-card h3 {
  margin: 0 0 2px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ivory-50);
}

.privacy-card .bn-note {
  margin: 0 0 6px;
  font-family: var(--font-bn);
  font-size: 0.78rem;
  font-weight: 500;
  color: #f9cd76;
}

.privacy-desc {
  margin: 0;
  font-size: 0.77rem;
  line-height: 1.48;
  color: rgba(252, 252, 244, 0.85);
}

/* Programmes Drawer */
.programmes-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--ivory-50);
}

.programmes-summary::-webkit-details-marker {
  display: none;
}

.programmes-summary svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.programmes-drawer[open] .programmes-summary svg {
  transform: rotate(180deg);
}

.programme-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.programme-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.77rem;
  line-height: 1.4;
  color: rgba(252, 252, 244, 0.84);
}

.programme-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--lime-brand);
  transform: rotate(45deg);
}

.rail-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(252, 252, 244, 0.14);
  font-size: 0.76rem;
  color: rgba(252, 252, 244, 0.78);
}

.rail-footer svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--lime-bright);
}

/* ==========================================================================
   RIGHT FORM WORKSPACE
   ========================================================================== */

.form-workspace {
  padding: 28px clamp(20px, 4vw, 56px) 56px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Mobile & Tablet Brand + Progress Strip */
.mobile-brand-banner {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, var(--forest-900) 0%, var(--forest-950) 100%);
  color: var(--ivory-50);
  box-shadow: var(--shadow-paper);
}

.mobile-brand-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-brand-text {
  min-width: 0;
}

.mobile-logo-wrap {
  width: 54px;
  flex-shrink: 0;
  padding: 4px;
  background: var(--ivory-50);
  border-radius: 10px;
  border: 1.5px solid rgba(142, 198, 41, 0.55);
}

.mobile-logo-wrap img {
  border-radius: 6px;
}

.mobile-brand-kicker {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.mobile-brand-sub {
  margin: 3px 0 0;
  font-size: 0.78rem;
  color: rgba(252, 252, 244, 0.85);
}

.mobile-progress-row {
  padding-top: 10px;
  border-top: 1px solid rgba(252, 252, 244, 0.14);
}

.mobile-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  margin-bottom: 6px;
  color: rgba(252, 252, 244, 0.85);
}

.mobile-progress-meta strong {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--lime-bright);
}

.mobile-progress-track {
  margin-bottom: 0;
}

/* Top Utility & Accessibility Bar */
.workspace-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.portal-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--forest-100);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--forest-900);
}

.live-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(29, 117, 66, 0.18);
}

.a11y-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.a11y-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.a11y-btn:hover {
  border-color: var(--forest-700);
  color: var(--forest-900);
}

.a11y-btn[aria-pressed="true"] {
  background: var(--forest-900);
  border-color: var(--forest-900);
  color: var(--ivory-50);
}

.contrast-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* Editorial Masthead */
.workspace-header {
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1.5px solid var(--border-subtle);
}

.header-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.dossier-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--forest-900);
  color: var(--lime-bright);
}

.required-legend {
  font-size: 0.82rem;
  color: var(--ink-500);
}

.req-star {
  color: var(--saffron-deep);
  font-weight: 700;
}

.workspace-header h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--forest-950);
}

.header-lead {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--ink-700);
  max-width: 66ch;
}

.header-lead-bn {
  margin: 0 0 16px;
  font-family: var(--font-bn);
  font-size: 0.94rem;
  color: var(--ink-500);
  max-width: 68ch;
}

.direct-notice-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--lime-soft);
  border: 1px solid rgba(142, 198, 41, 0.45);
  color: var(--forest-950);
}

.direct-notice-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--forest-900);
  color: var(--lime-bright);
  display: grid;
  place-items: center;
}

.direct-notice-icon svg {
  width: 17px;
  height: 17px;
}

.direct-notice-text {
  font-size: 0.85rem;
  line-height: 1.45;
}

.direct-notice-text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 1px;
}

/* ==========================================================================
   CHAPTER CARDS & FORM CONTROLS
   ========================================================================== */

.dossier-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.form-error-summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  border: 1.5px solid var(--danger);
  color: #6b1b12;
}

.form-error-summary[hidden] {
  display: none;
}

.error-summary-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--danger);
  color: #ffffff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.form-error-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.88rem;
}

.form-chapter {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 3vw, 30px);
  box-shadow: var(--shadow-paper);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-chapter:focus-within {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}

.chapter-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ivory-200);
}

.chapter-header > div {
  min-width: 0;
  flex: 1 1 200px;
}

.chapter-number {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--forest-900);
  color: var(--lime-bright);
  flex-shrink: 0;
}

.chapter-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  color: var(--forest-950);
  line-height: 1.2;
}

.chapter-bn {
  margin: 2px 0 0;
  font-family: var(--font-bn);
  font-size: 0.88rem;
  color: var(--ink-500);
}

.chapter-spec-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--ivory-100);
  border: 1px solid var(--border-subtle);
  color: var(--ink-700);
}

.chapter-note {
  margin: -6px 0 18px;
  font-size: 0.88rem;
  color: var(--ink-700);
}

/* Text Fields Grid */
.fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 20px;
}

.field-full {
  grid-column: 1 / -1;
}

.field-group label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.label-main {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-900);
}

.label-bn {
  font-family: var(--font-bn);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-500);
}

.field-group input[type="text"],
.field-group input[type="tel"],
.field-group textarea,
.other-input-drawer input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--ivory-50);
  color: var(--ink-900);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

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

.field-group input::placeholder,
.field-group textarea::placeholder,
.other-input-drawer input::placeholder {
  color: var(--ink-400);
}

.field-group input:hover,
.field-group textarea:hover {
  border-color: var(--border-strong);
}

.field-group input:focus,
.field-group textarea:focus,
.other-input-drawer input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--forest-800);
  box-shadow: var(--shadow-focus);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--ink-500);
}

.field-error {
  margin: 6px 0 0;
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--danger);
  min-height: 0;
}

.field-error:empty {
  display: none;
}

.is-invalid input,
.is-invalid textarea,
.is-invalid .dropzone {
  border-color: var(--danger) !important;
  background-color: var(--danger-soft);
}

/* Custom Searchable District Dropdown */
.district-combobox {
  position: relative;
}

.district-combobox input[type="text"] {
  padding-right: 44px;
}

.combobox-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-500);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.2s ease;
}

.combobox-toggle:hover {
  background: var(--ivory-200);
  color: var(--forest-900);
}

.combobox-toggle svg {
  width: 17px;
  height: 17px;
  transition: transform 0.2s ease;
}

.combobox-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.district-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: min(250px, 38vh);
  overflow-y: auto;
  background: var(--surface-card);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 36px -12px rgba(12, 38, 23, 0.28);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.district-dropdown[hidden] {
  display: none;
}

.district-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink-900);
  transition: background-color 0.12s ease, color 0.12s ease;
}

.district-option:hover,
.district-option.is-highlighted {
  background: var(--lime-soft);
  color: var(--forest-950);
}

.district-option.is-selected {
  background: var(--forest-100);
  font-weight: 700;
}

.district-name-match {
  font-weight: 700;
  color: var(--forest-800);
  text-decoration: underline;
  text-decoration-color: rgba(142, 198, 41, 0.7);
  text-underline-offset: 2px;
}

.district-division {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ivory-100);
  border: 1px solid var(--border-subtle);
  color: var(--ink-500);
  flex-shrink: 0;
}

.district-empty-note {
  padding: 10px 12px;
  font-size: 0.84rem;
  color: var(--ink-500);
}

/* ==========================================================================
   DISABILITY RADIO CARDS
   ========================================================================== */

.disability-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.disability-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.radio-card {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--ivory-50);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}

.radio-card:hover {
  border-color: var(--forest-700);
  background: #ffffff;
  transform: translateY(-1px);
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.radio-indicator {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: #ffffff;
  position: relative;
  transition: all 0.18s ease;
}

.radio-card input[type="radio"]:focus-visible+.radio-indicator {
  box-shadow: var(--shadow-focus);
  border-color: var(--forest-900);
}

.radio-card input[type="radio"]:checked+.radio-indicator {
  border-color: var(--forest-900);
  background: var(--forest-900);
}

.radio-card input[type="radio"]:checked+.radio-indicator::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--lime-bright);
}

.radio-card:has(input[type="radio"]:checked) {
  border-color: var(--forest-900);
  background: var(--lime-soft);
  box-shadow: 0 4px 14px -6px rgba(19, 60, 36, 0.25);
}

.radio-text .en {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.35;
}

.radio-text .bn {
  display: block;
  margin-top: 3px;
  font-family: var(--font-bn);
  font-size: 0.83rem;
  color: var(--ink-500);
  line-height: 1.4;
}

.radio-card-other {
  grid-column: 1 / -1;
}

.other-input-drawer {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--saffron-soft);
  border: 1.5px solid rgba(232, 119, 34, 0.45);
}

.other-input-drawer[hidden] {
  display: none;
}

.other-input-drawer label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.label-bn-inline {
  font-family: var(--font-bn);
  font-weight: 500;
  color: var(--ink-700);
}

/* ==========================================================================
   NID FRONT & BACK DUAL UPLOAD BOXES + PHOTO UPLOAD
   ========================================================================== */

.nid-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.upload-box-wrapper {
  display: flex;
  flex-direction: column;
}

.upload-box-label {
  margin-bottom: 10px;
}

.side-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 5px;
}

.side-front {
  background: var(--lime-soft);
  color: var(--forest-900);
  border: 1px solid rgba(142, 198, 41, 0.5);
}

.side-back {
  background: var(--saffron-soft);
  color: #8a3c04;
  border: 1px solid rgba(232, 119, 34, 0.45);
}

.upload-box-label h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-900);
}

.bn-sub {
  display: block;
  font-family: var(--font-bn);
  font-size: 0.82rem;
  color: var(--ink-500);
}

.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--ivory-50);
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.dropzone.is-dragover {
  border-color: var(--saffron-brand);
  background: var(--saffron-soft);
  transform: scale(1.01);
}

.dropzone.has-file {
  border-style: solid;
  border-color: var(--success);
  background: #ffffff;
}

.dropzone-empty {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 6px;
}

.dropzone-empty:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.dropzone-empty[hidden],
.dropzone-preview[hidden] {
  display: none;
}

.id-schematic {
  width: 156px;
  transition: transform 0.25s ease;
}

.dropzone-empty:hover .id-schematic {
  transform: translateY(-2px);
}

.dropzone-photo {
  min-height: 175px;
}

.dropzone-empty-horizontal {
  flex-direction: row;
  text-align: left;
  justify-content: flex-start;
  gap: 20px;
  padding: 6px 10px;
}

.portrait-schematic {
  width: 82px;
  flex-shrink: 0;
}

.dropzone-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dropzone-cta-left {
  align-items: flex-start;
}

.upload-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--forest-900);
  color: var(--lime-bright);
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}

.upload-icon-circle svg {
  width: 17px;
  height: 17px;
}

.cta-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-900);
}

.cta-title em {
  font-style: normal;
  color: var(--forest-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cta-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-500);
}

.cta-subhint {
  font-size: 0.78rem;
  color: var(--ink-500);
  margin-top: 2px;
}

/* File Preview Inside Dropzone */
.dropzone-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-media-frame {
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--ivory-100);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-media-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f8f9f2;
}

.pdf-badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  text-align: center;
  color: var(--forest-900);
}

.pdf-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--saffron-brand);
  color: #ffffff;
}

.preview-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
}

.preview-file-info {
  min-width: 0;
}

.preview-filename {
  display: block;
  font-weight: 700;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-filesize {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--success);
  font-weight: 600;
}

.preview-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-mini {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--ivory-50);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-mini:hover {
  border-color: var(--forest-800);
  background: var(--forest-100);
}

.btn-mini-danger:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger);
}

/* Smart Client-side Compression Helper */
.compress-helper {
  margin-top: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  background: var(--saffron-soft);
  border: 1.5px solid rgba(232, 119, 34, 0.55);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compress-helper[hidden] {
  display: none;
}

.compress-copy strong {
  display: block;
  font-size: 0.88rem;
  color: #7c3103;
}

.compress-copy span {
  font-size: 0.8rem;
  color: var(--ink-700);
}

.btn-optimize {
  padding: 9px 15px;
  border: 0;
  border-radius: 10px;
  background: var(--saffron-brand);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-optimize:hover {
  background: var(--saffron-deep);
  transform: translateY(-1px);
}

/* ==========================================================================
   SUBMIT & CLEAR ACTIONS BAR
   ========================================================================== */

.form-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 6px;
}

.btn-submit {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 28px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--forest-900), var(--forest-800));
  color: var(--ivory-50);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px -10px rgba(19, 60, 36, 0.55);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, background-color 0.2s ease;
}

.btn-submit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.22) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.65s ease;
  pointer-events: none;
}

.btn-submit:hover::after {
  transform: translateX(120%);
}

.btn-submit:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px rgba(19, 60, 36, 0.65);
  background: linear-gradient(135deg, var(--forest-800), var(--forest-700));
}

.btn-submit:focus-visible,
.btn-clear:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn-submit-bn {
  font-family: var(--font-bn);
  font-weight: 500;
  color: var(--lime-bright);
  font-size: 0.94rem;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.btn-submit:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-submit.is-loading {
  opacity: 0.78;
  pointer-events: none;
}

.btn-clear {
  padding: 13px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-card);
  color: var(--ink-700);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-clear:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.form-footnote {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-500);
}

.powered-by {
  margin: 6px 0 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-500);
  letter-spacing: 0.01em;
}

.powered-by a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.powered-by a:hover {
  color: var(--forest-800);
  text-decoration: underline;
}

/* ==========================================================================
   MODALS (LIGHTBOX, CONFIRM CLEAR, RECEIPT)
   ========================================================================== */

.modal-dialog {
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: transparent;
  max-width: min(760px, 94vw);
  max-height: 92vh;
  width: 100%;
  overflow-y: auto;
  box-shadow: 0 28px 60px -15px rgba(12, 38, 23, 0.45);
}

.modal-dialog::backdrop {
  background: rgba(12, 38, 23, 0.65);
  backdrop-filter: blur(4px);
}

.modal-compact {
  max-width: min(460px, 92vw);
}

.modal-surface {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 24px;
  color: var(--ink-900);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ivory-200);
}

.modal-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--forest-700);
  margin-bottom: 2px;
}

.modal-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--forest-950);
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--ivory-50);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--ivory-200);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-copy {
  margin: 16px 0 22px;
  font-size: 0.94rem;
  color: var(--ink-700);
}

.lightbox-body {
  padding-top: 18px;
  max-height: 70vh;
  overflow: auto;
  display: flex;
  justify-content: center;
}

.lightbox-body img {
  max-height: 64vh;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.lightbox-body iframe {
  width: 100%;
  height: 62vh;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--ivory-200);
  margin-top: 18px;
}

.btn-secondary {
  padding: 11px 18px;
  border-radius: 10px;
  border: 1.5px solid var(--border-subtle);
  background: var(--ivory-50);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--forest-800);
  background: var(--forest-100);
}

.btn-danger {
  padding: 11px 18px;
  border-radius: 10px;
  border: 0;
  background: var(--danger);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-modal-done {
  padding: 11px 20px;
  font-size: 0.9rem;
}

/* Receipt Modal Specifics */
.receipt-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.receipt-logo {
  width: 52px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  padding: 3px;
  background: var(--ivory-50);
}

.receipt-status-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  margin-bottom: 4px;
}

.receipt-ref {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--ink-500);
}

.receipt-body {
  padding-top: 16px;
}

.receipt-notice {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--lime-soft);
  border: 1px solid rgba(142, 198, 41, 0.45);
  font-size: 0.84rem;
  color: var(--forest-950);
  margin-bottom: 16px;
}

.receipt-details {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--ivory-50);
  border: 1px solid var(--border-subtle);
}

.receipt-details div {
  min-width: 0;
}

.receipt-details .detail-full {
  grid-column: 1 / -1;
}

.receipt-details dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  text-transform: uppercase;
}

.receipt-details dd {
  margin: 3px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-900);
  word-break: break-word;
}

.receipt-attachments {
  margin-top: 18px;
}

.receipt-attachments h4 {
  margin: 0 0 10px;
  font-size: 0.88rem;
  color: var(--ink-700);
}

.receipt-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.receipt-thumb-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px;
  background: var(--ivory-50);
  text-align: center;
}

.receipt-thumb-card span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: 6px;
}

.receipt-thumb-card img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 6px;
}

.receipt-thumb-card .pdf-mini {
  height: 88px;
  display: grid;
  place-items: center;
  background: var(--saffron-soft);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--saffron-deep);
}

/* ==========================================================================
   ENTRANCE MOTION & RESPONSIVE BREAKPOINTS
   ========================================================================== */

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(29, 117, 66, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(29, 117, 66, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(29, 117, 66, 0);
  }
}

@keyframes progressSheen {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@keyframes stepPop {
  0% {
    transform: scale(0.8);
  }
  60% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes radioPop {
  0% {
    transform: scale(0.75);
  }
  55% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes previewPop {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes gentleShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  85% { transform: translateX(3px); }
}

/* Live Portal Dot Pulse */
.live-dot {
  animation: livePulse 2.2s infinite;
}

/* Brand Rail Staggered Entrance */
.brand-rail .brand-card {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}
.brand-rail .progress-panel {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}
.brand-rail .programmes-drawer {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.logo-medallion {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}
.brand-card:hover .logo-medallion {
  transform: translateY(-2px) rotate(-1.5deg) scale(1.03);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
}

/* Workspace Header Staggered Entrance */
.workspace-topbar {
  animation: riseIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.04s both;
}
.workspace-header {
  animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* Scroll-triggered Chapter Card Entrance */
html.has-motion .form-chapter {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
html.has-motion .form-chapter.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animated Progress Bar & Step Completion */
.progress-bar-fill {
  background-size: 200% 100%;
  animation: progressSheen 3.5s linear infinite;
}
.step-item.is-complete .step-dot {
  animation: stepPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Interactive Dropdown, Radio, Dropzones & Modals */
.district-dropdown:not([hidden]) {
  animation: dropdownIn 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top center;
}

.radio-card input[type="radio"]:checked + .radio-indicator {
  animation: radioPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.other-input-drawer:not([hidden]) {
  animation: riseIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.dropzone-empty:hover .upload-icon-circle,
.dropzone.is-dragover .upload-icon-circle {
  transform: translateY(-3px) scale(1.06);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.dropzone-preview:not([hidden]) {
  animation: previewPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-dialog[open] .modal-surface {
  animation: modalIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.form-error-summary:not([hidden]) {
  animation: gentleShake 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS: DESKTOP PC, LAPTOP, TABLET & MOBILE
   ========================================================================== */

/* Large Desktop PC (1440px+) */
@media (min-width: 1440px) {
  .form-workspace {
    max-width: 1040px;
    padding: 36px 60px 64px;
  }
}

/* Standard & Compact Laptops (1024px - 1279px) */
@media (min-width: 1024px) and (max-width: 1279px) {
  :root {
    --rail-width: 325px;
  }

  .rail-inner {
    padding: 20px 18px;
    gap: 14px;
  }

  .brand-card {
    padding: 13px;
    gap: 12px;
  }

  .logo-medallion {
    width: 68px;
  }

  .brand-title {
    font-size: 1.35rem;
  }

  .form-workspace {
    padding: 24px 28px 48px;
  }
}

/* Short-Height Laptops (e.g. 1366x768, 1280x720) — prevent clipped sidebar */
@media (min-width: 1024px) and (max-height: 820px) {
  .rail-inner {
    padding: 16px 18px;
    gap: 11px;
  }

  .brand-card {
    padding: 12px;
  }

  .logo-medallion {
    width: 66px;
  }

  .rail-section {
    padding: 12px 14px;
  }

  .step-tracker {
    gap: 6px;
  }

  .step-item {
    padding: 4px 6px;
  }
}

/* Tablet & Below (< 1024px): iPad Portrait/Landscape & Android Tablets */
@media (max-width: 1023px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .form-workspace {
    padding: 20px clamp(16px, 3.5vw, 36px) 36px;
  }

  .brand-rail {
    order: 2;
    border-right: 0;
    border-top: 1px solid rgba(252, 252, 244, 0.14);
  }

  .rail-inner {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px clamp(16px, 3.5vw, 36px);
  }

  .brand-rail .brand-card,
  .brand-rail .progress-panel {
    display: none;
  }

  .rail-footer {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .mobile-brand-banner {
    display: flex;
  }
}

/* Small Tablets & Large Phones (<= 767px) */
@media (max-width: 767px) {
  .rail-inner {
    grid-template-columns: 1fr;
    padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  }

  .fields-grid,
  .disability-grid,
  .nid-grid,
  .receipt-details,
  .receipt-thumbs {
    grid-template-columns: 1fr;
  }

  /* Prevent iOS/Android Safari input auto-zoom on focus (< 16px) */
  .field-group input[type="text"],
  .field-group input[type="tel"],
  .field-group textarea,
  .other-input-drawer input[type="text"] {
    font-size: 16px;
    min-height: 46px;
  }

  .radio-card {
    min-height: 52px;
    padding: 13px 14px;
  }

  .district-option {
    min-height: 44px;
    padding: 10px 12px;
  }

  .a11y-btn,
  .btn-mini,
  .btn-optimize,
  .btn-secondary,
  .btn-danger {
    min-height: 42px;
  }

  .dropzone {
    min-height: 200px;
    padding: 14px;
  }

  .dropzone-empty-horizontal {
    flex-direction: column;
    text-align: center;
  }

  .dropzone-cta-left {
    align-items: center;
  }

  .chapter-spec-badge {
    margin-left: 0;
  }

  .form-actions-bar {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .btn-submit,
  .btn-clear {
    width: 100%;
    min-height: 50px;
    justify-content: center;
  }

  .modal-dialog {
    max-width: 96vw;
    max-height: 94dvh;
  }

  .modal-surface {
    padding: 18px 16px;
  }

  .modal-footer-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .modal-footer-actions button {
    width: 100%;
    justify-content: center;
  }
}

/* Narrow Smartphones (<= 560px) */
@media (max-width: 560px) {
  .form-workspace {
    padding: 14px 12px 28px;
  }

  .form-chapter {
    padding: 16px 14px;
    border-radius: var(--radius-lg);
  }

  .workspace-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .portal-pill {
    justify-content: center;
    text-align: center;
  }

  .a11y-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .a11y-btn {
    justify-content: center;
  }

  .preview-meta-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .preview-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .btn-mini {
    text-align: center;
    padding: 8px 6px;
  }

  .receipt-brand-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Clean Print Receipt Styles */
@media print {
  body {
    background: #ffffff;
  }

  .page-shell,
  .no-print {
    display: none !important;
  }

  .modal-dialog#receiptModal {
    position: static;
    max-width: 100%;
    max-height: none;
    overflow: visible;
    margin: 0;
    box-shadow: none;
  }

  .modal-dialog#receiptModal::backdrop {
    display: none;
  }

  .modal-surface {
    border: 0;
    padding: 0;
  }
}