/* ============================================================
   EXTRAORDINARY KIDS — APPLICATION FORM STYLES
   File: application.css
   Used by: public/application.html
   ============================================================ */
:root {
  --brand-blue: #0253C3;
  --brand-red: #FD0100;
  --brand-yellow: #FDD413;
  --brand-green: #83E473;
  --brand-coral: #FC5D53;
  --black: #000;
  --white: #FFF;
  --line: #111;
  --footer-h: 24mm;
  --rainbow-h: 200px;
  --wm-opacity: 0.06;
  --sidebar-width: 0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  font-family: 'Nunito', sans-serif;
  background: linear-gradient(145deg, #f0f9ff 0%, #e6f4ff 40%, #fff8e7 100%);
  color: var(--black);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ============================================================
   ANIMATIONS
============================================================ */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(253,212,19,.6); } 70% { box-shadow: 0 0 0 18px rgba(253,212,19,0); } 100% { box-shadow: 0 0 0 0 rgba(253,212,19,0); } }
@keyframes gradientFlow { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes bounceIn { 0% { opacity: 0; transform: scale(.3); } 50% { opacity: 1; transform: scale(1.05); } 70% { transform: scale(.95); } 100% { transform: scale(1); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes checkPop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.bounce-in { animation: bounceIn 1.2s cubic-bezier(.68,-.55,.27,1.55) forwards; }
.slide-up { animation: slideUp .8s ease forwards; }
.pulse-anim { animation: pulseGlow 2.5s infinite; }
.float-anim { animation: float 4s ease-in-out infinite; }
.shake-anim { animation: shake .4s ease; }

/* ============================================================
   PRELOADER — APPLICATION PORTAL EDITION
============================================================ */
.portal-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  background: linear-gradient(135deg, #eaf6ff 0%, #fff9d9 50%, #fff0f4 100%);
  overflow: hidden;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.portal-preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Background Bubbles */
.portal-bg-bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.portal-bg-bubbles span {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  opacity: 0.35;
  animation: bubbleRise 8s linear infinite;
}
.portal-bg-bubbles span:nth-child(1)  { left: 5%;  width: 40px; height: 40px; background: var(--brand-blue);   animation-delay: 0s;   animation-duration: 9s; }
.portal-bg-bubbles span:nth-child(2)  { left: 15%; width: 25px; height: 25px; background: var(--brand-red);    animation-delay: 1.2s; animation-duration: 7s; }
.portal-bg-bubbles span:nth-child(3)  { left: 28%; width: 55px; height: 55px; background: var(--brand-yellow); animation-delay: 0.6s; animation-duration: 10s; }
.portal-bg-bubbles span:nth-child(4)  { left: 42%; width: 30px; height: 30px; background: var(--brand-green);  animation-delay: 2.1s; animation-duration: 8.5s; }
.portal-bg-bubbles span:nth-child(5)  { left: 55%; width: 45px; height: 45px; background: var(--brand-coral);  animation-delay: 0.9s; animation-duration: 9.5s; }
.portal-bg-bubbles span:nth-child(6)  { left: 68%; width: 22px; height: 22px; background: var(--brand-blue);   animation-delay: 1.8s; animation-duration: 7.5s; }
.portal-bg-bubbles span:nth-child(7)  { left: 78%; width: 50px; height: 50px; background: var(--brand-yellow); animation-delay: 0.3s; animation-duration: 11s; }
.portal-bg-bubbles span:nth-child(8)  { left: 88%; width: 35px; height: 35px; background: var(--brand-red);    animation-delay: 2.5s; animation-duration: 8s; }
.portal-bg-bubbles span:nth-child(9)  { left: 33%; width: 18px; height: 18px; background: var(--brand-green);  animation-delay: 3.2s; animation-duration: 6.5s; }
.portal-bg-bubbles span:nth-child(10) { left: 62%; width: 28px; height: 28px; background: var(--brand-coral);  animation-delay: 1.5s; animation-duration: 9.2s; }

@keyframes bubbleRise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-110vh) scale(1.2); opacity: 0; }
}

/* Spinner Stage */
.portal-spinner-stage {
  position: relative;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Rotating Rings */
.portal-spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 4px dashed rgba(2, 83, 195, 0.25);
  animation: ringSpin 12s linear infinite;
}
.portal-spinner-ring { inset: 0; }
.portal-spinner-ring-2 {
  inset: 24px;
  border-color: rgba(253, 212, 19, 0.4);
  animation: ringSpin 9s linear infinite reverse;
}
.portal-spinner-ring-3 {
  inset: 48px;
  border-color: rgba(253, 1, 0, 0.18);
  animation: ringSpin 6s linear infinite;
  border-style: dotted;
}
@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

/* Orbit Rings */
.portal-orbit-ring {
  position: absolute;
  inset: 0;
  animation: ringSpin 8s linear infinite;
}
.portal-orbit-ring-2 {
  inset: 32px;
  animation: ringSpin 6s linear infinite reverse;
}
.portal-orbit-item {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 6px 15px rgba(2, 83, 195, 0.2);
  border: 2px solid #fff;
}
.portal-orbit-item-1 { color: var(--brand-blue);   transform: translateX(-50%) rotate(0deg)   translateY(0)   rotate(0deg); }
.portal-orbit-item-2 { color: var(--brand-red);    transform: translateX(-50%) rotate(90deg)  translateY(0)   rotate(-90deg); top: 50%; left: calc(100% + 18px); }
.portal-orbit-item-3 { color: var(--brand-yellow); transform: translateX(-50%) rotate(180deg) translateY(0)   rotate(0deg); top: calc(100% + 18px); }
.portal-orbit-item-4 { color: var(--brand-green);  transform: translateX(-50%) rotate(270deg) translateY(0)   rotate(-90deg); top: 50%; left: -18px; }

.portal-orbit-ring .portal-orbit-item-1 { top: -18px; left: 50%; }
.portal-orbit-ring .portal-orbit-item-2 { top: 50%; left: calc(100% - 20px); }
.portal-orbit-ring .portal-orbit-item-3 { top: calc(100% - 20px); left: 50%; }
.portal-orbit-ring .portal-orbit-item-4 { top: 50%; left: -20px; }

/* Center Application Icon */
.portal-center-icon {
  position: relative;
  z-index: 5;
  animation: pencilBob 2s ease-in-out infinite;
}
@keyframes pencilBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-10px) rotate(4deg); }
}

.portal-icon-body {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(2, 83, 195, 0.3);
}
.portal-icon-body i {
  font-size: 2.5rem;
  color: #fff;
}

/* Floating Blocks */
.portal-block {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
  z-index: 4;
  animation: blockFloat 3s ease-in-out infinite;
}
.portal-block-a { top: 8%;  left: 4%;   background: var(--brand-blue);   animation-delay: 0s;   }
.portal-block-b { top: 12%; right: 4%;  background: var(--brand-red);    animation-delay: 0.5s; }
.portal-block-c { bottom: 10%; left: 6%; background: var(--brand-green); animation-delay: 1s;   color: #063676; }
.portal-block-1 { bottom: 8%; right: 6%; background: var(--brand-yellow); animation-delay: 1.5s; color: #063676; }
.portal-block-2 { top: 45%;  left: -2%;  background: var(--brand-coral);  animation-delay: 0.8s; }

@keyframes blockFloat {
  0%, 100% { transform: translateY(0)     rotate(-8deg); }
  50%      { transform: translateY(-18px) rotate(8deg); }
}

/* Sparkles */
.portal-sparkle {
  position: absolute;
  color: var(--brand-yellow);
  font-size: 1.4rem;
  animation: sparkleTwinkle 1.8s ease-in-out infinite;
  z-index: 3;
}
.portal-sparkle-1 { top: 20%; left: 20%; animation-delay: 0s;   color: var(--brand-yellow); }
.portal-sparkle-2 { top: 30%; right: 18%; animation-delay: 0.4s; color: var(--brand-coral); }
.portal-sparkle-3 { bottom: 25%; left: 18%; animation-delay: 0.8s; color: var(--brand-green); }
.portal-sparkle-4 { bottom: 20%; right: 22%; animation-delay: 1.2s; color: var(--brand-blue); }

@keyframes sparkleTwinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.3) rotate(180deg); }
}

/* Loading Text */
.portal-preloader-text {
  display: flex;
  gap: 2px;
  font-family: 'Nunito', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--brand-blue);
  z-index: 3;
}
.portal-letter {
  display: inline-block;
  animation: letterBounce 1.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.08s);
}
.portal-letter-space { width: 12px; }
.portal-letter:nth-child(5n+1)  { color: var(--brand-blue); }
.portal-letter:nth-child(5n+2)  { color: var(--brand-red); }
.portal-letter:nth-child(5n+3)  { color: #b47900; }
.portal-letter:nth-child(5n+4)  { color: #167a5b; }
.portal-letter:nth-child(5n+5)  { color: var(--brand-coral); }

@keyframes letterBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-14px); }
}

/* Progress Bar */
.portal-preloader-progress {
  width: min(320px, 70vw);
  height: 10px;
  background: rgba(2, 83, 195, 0.12);
  border-radius: 20px;
  overflow: hidden;
  z-index: 3;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}
.portal-progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 20px;
  background: linear-gradient(90deg,
    var(--brand-blue) 0%,
    var(--brand-red) 25%,
    var(--brand-yellow) 50%,
    var(--brand-green) 75%,
    var(--brand-blue) 100%);
  background-size: 200% 100%;
  animation: gradientFlow 1.5s linear infinite;
  transition: width 0.2s ease;
}

/* Brand Tagline */
.portal-preloader-tagline {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: #063676;
  letter-spacing: 0.5px;
  z-index: 3;
  opacity: 0.85;
  animation: taglinePulse 2s ease-in-out infinite;
}
.portal-preloader-tagline i {
  color: var(--brand-red);
  margin-right: 6px;
}
@keyframes taglinePulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.04); }
}

/* Responsive */
@media (max-width: 576px) {
  .portal-spinner-stage { width: 260px; height: 260px; }
  .portal-preloader-text { font-size: 1.2rem; }
  .portal-block { width: 34px; height: 34px; font-size: 1rem; }
  .portal-icon-body { width: 64px; height: 64px; border-radius: 18px; }
  .portal-icon-body i { font-size: 2rem; }
  .portal-orbit-item { width: 32px; height: 32px; font-size: 0.85rem; }
}
/* ============================================================
   TOP BAR — sticky with Back Home + Progress
============================================================ */
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 3px solid rgba(253,212,19,.4);
  padding: .7rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 6px 20px rgba(2,83,195,.06);
}
.app-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  color: var(--brand-blue);
  font-size: 1rem;
  flex-shrink: 0;
}
.app-topbar-brand img {
  height: 42px;
  width: auto;
  border-radius: 8px;
}
.app-topbar-brand span { white-space: nowrap; }
.btn-back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-blue), #013a8a);
  color: #fff !important;
  font-weight: 800;
  padding: .6rem 1.3rem;
  border-radius: 50px;
  border: none;
  text-decoration: none;
  box-shadow: 0 6px 0 #013a8a, 0 10px 24px -8px rgba(2,83,195,.5);
  transition: all .2s cubic-bezier(.175,.885,.32,1.275);
  font-size: .9rem;
  white-space: nowrap;
}
.btn-back-home:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #013a8a, 0 18px 30px -10px rgba(2,83,195,.7);
  color: #fff;
}
.btn-back-home:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #013a8a;
}
.btn-back-home i { transition: transform .3s ease; }
.btn-back-home:hover i { transform: translateX(-4px); }

.app-topbar-progress {
  flex: 1;
  min-width: 150px;
  height: 10px;
  background: rgba(2,83,195,.1);
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}
.app-topbar-progress .fill {
  height: 100%;
  width: 0%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red), var(--brand-yellow), var(--brand-green), var(--brand-blue));
  background-size: 200% 100%;
  animation: gradientFlow 1.5s linear infinite;
  transition: width .3s ease;
}
.app-topbar-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 900;
  color: #063676;
  letter-spacing: .5px;
  text-shadow: 0 1px 2px rgba(255,255,255,.8);
}

/* ============================================================
   HERO BANNER — with added logo (fully visible)
============================================================ */
.app-hero {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #013a8a 40%, var(--brand-blue) 100%);
  padding: 3.5rem 1.5rem 2.5rem;
  position: relative;
  overflow: hidden;
  color: #fff;
}
.app-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(253,212,19,.28) 0%, transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(252,93,83,.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(131,228,115,.18) 0%, transparent 60%);
  pointer-events: none;
}
.app-hero-content {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
/* Logo beside the text — fully visible, no borders */
.app-hero-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-hero-logo img {
  height: 110px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.25));
  transition: transform .2s ease;
}
.app-hero-logo img:hover {
  transform: scale(1.02);
}
.app-hero-text {
  flex: 1 1 300px;
  text-align: left;
  min-width: 280px;
}
@media (max-width: 768px) {
  .app-hero-content {
    flex-direction: column;
    text-align: center;
  }
  .app-hero-text {
    text-align: center;
  }
  .app-hero-logo img {
    height: 80px;
  }
}
.app-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(253,212,19,.5);
  color: #fff;
  font-weight: 900;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .5rem 1.2rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
  backdrop-filter: blur(10px);
}
.app-hero-eyebrow i { color: var(--brand-yellow); }
.app-hero h1 {
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1rem;
  text-shadow: 0 4px 15px rgba(0,0,0,.3);
}
.app-hero h1 span { color: var(--brand-yellow); }
.app-hero p {
  font-size: clamp(.95rem, 2vw, 1.2rem);
  font-weight: 600;
  opacity: .95;
  max-width: 700px;
  margin: 0 0 1.8rem 0;
  line-height: 1.6;
}
.app-hero-features {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .app-hero-features {
    justify-content: center;
  }
}
.app-hero-feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  padding: .5rem 1.1rem;
  border-radius: 40px;
  font-weight: 800;
  font-size: .85rem;
  backdrop-filter: blur(10px);
}
.app-hero-feature i { color: var(--brand-yellow); }

/* Floating decorations */
.app-hero-deco {
  position: absolute;
  font-size: 2.5rem;
  opacity: .35;
  pointer-events: none;
  z-index: 1;
}
.deco-sun { top: 15%; left: 4%; color: var(--brand-yellow); animation: float 5s infinite; }
.deco-cloud { top: 30%; right: 5%; color: #ACE4FD; animation: float 7s infinite reverse; }
.deco-rocket { bottom: 15%; right: 8%; color: var(--brand-coral); animation: float 6s infinite; }
.deco-star { bottom: 20%; left: 6%; color: var(--brand-yellow); animation: float 5.5s infinite; }

/* ============================================================
   FORM WRAPPER
============================================================ */
.app-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.app-instructions {
  background: linear-gradient(135deg, #fff9d9, #ffffff);
  border: 2px dashed var(--brand-yellow);
  border-radius: 24px;
  padding: 1.3rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.app-instructions i {
  font-size: 1.8rem;
  color: var(--brand-red);
  flex-shrink: 0;
  animation: float 3s infinite;
}
.app-instructions strong {
  display: block;
  color: #063676;
  font-weight: 900;
  font-size: 1rem;
  margin-bottom: .3rem;
}
.app-instructions p {
  margin: 0;
  color: #5a3e00;
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.5;
}

/* ============================================================
   THE APPROVED REGISTRATION FORM (WRAPPED)
============================================================ */
.form-page {
  width: 100%;
  max-width: 100%;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  padding: 24px 24px 0;
  margin-bottom: 28px;
  border-radius: 24px;
  box-shadow: 0 20px 50px -15px rgba(2,83,195,.15);
  display: flex;
  flex-direction: column;
  border: 2px solid rgba(253,212,19,.2);
}
.page-body {
  flex: 1 1 auto;
  padding-bottom: 1.5rem;
}
.page-header {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 6px;
}
.logo { width: 100%; max-width: 140px; height: auto; object-fit: contain; display: block; }
.heading {
  color: var(--brand-blue);
  font-size: clamp(1rem, 3vw, 1.6rem);
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}
.heading .line { display: block; }
.contact {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 2px solid #111;
  font-size: .8rem;
  line-height: 1.5;
}
.contact .contact-line { display: block; }
.title-divider { margin-top: 8px; padding-top: 7px; border-top: 2px solid #111; }
.rocket-corner { display: block; width: 60px; height: auto; margin-left: auto; margin-top: 4px; }
.section-title { margin: 14px 0 8px; font-size: clamp(.95rem,2.5vw,1.2rem); font-weight: 800; }
.sub-title { margin: 12px 0 6px; font-size: clamp(.85rem,2vw,1rem); font-weight: 800; }
.hours { margin: 2px 0 10px; font-size: .95rem; font-weight: 800; }

/* Tables */
.table-form {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: clamp(.7rem,1.7vw,.85rem);
}
.table-form td, .table-form th {
  padding: 6px 8px;
  border: 1px solid var(--line);
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.table-form th { font-weight: 800; }
.table-form input, .table-form textarea, .table-form select {
  width: 100%;
  min-width: 0;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-weight: 500;
  text-transform: uppercase;
}

/* 🎯 Email inputs always display in lowercase (never uppercase) */
.table-form input[type="email"],
.address-table input[type="email"],
.guardian-col .table-form input[type="email"] {
  text-transform: lowercase;
}
.table-form input.has-value, .table-form textarea.has-value { font-weight: 700; }

/* ============================================================
   🏆 WORLD-CLASS AUTO-FIT FONT SYSTEM
   ------------------------------------------------------------
   As the user types, if the text is longer than the cell can
   hold, we smoothly shrink the font size (down to a readable
   minimum) so nothing is ever cut off. Uses binary search for
   pixel-perfect fitting.
   ============================================================ */

/* Smooth font-size transitions on every auto-fit target */
.table-form input,
.table-form textarea,
.table-form select,
.address-table input,
.medical-declaration-text .inline-field input,
.medical-signature-box .sig-input input,
.guardian-col .table-form input {
  transition:
    font-size 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    letter-spacing 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.25s ease;
  font-size: 0.85rem; /* baseline — the JS will override per-field */
  will-change: font-size;
}

/* When a field is actively auto-fitting, keep the cell background unchanged */
.table-form td.ek-fitting,
.address-table td.ek-fitting,
.guardian-col .table-form td.ek-fitting {
  background: transparent;
}

/* Smoothly shrink letter-spacing too for very long strings */
.table-form input.ek-dense,
.table-form textarea.ek-dense,
.address-table input.ek-dense,
.guardian-col .table-form input.ek-dense {
  letter-spacing: -0.01em;
}

/* Tiny visual tick marks showing auto-fit boundaries — subtle, classy */
.table-form td,
.address-table td,
.guardian-col .table-form td {
  position: relative;
  transition: background 0.25s ease;
}

/* Responsive baseline sizing */
@media (max-width: 768px) {
  .table-form input,
  .table-form textarea,
  .address-table input,
  .guardian-col .table-form input {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .table-form input,
  .table-form textarea,
  .address-table input,
  .guardian-col .table-form input {
    font-size: 0.78rem;
  }
}

/* Accessibility — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .table-form input,
  .table-form textarea,
  .table-form select,
  .address-table input,
  .guardian-col .table-form input {
    transition: none;
  }
}

.table-form input::placeholder, .table-form textarea::placeholder {
  font-weight: 400;
  text-transform: none;
  color: #9aa7b8;
  font-style: italic;
}
/* Email placeholder — natural case, never forced to uppercase */
.table-form input[type="email"]::placeholder,
.address-table input[type="email"]::placeholder {
  text-transform: none;
  text-transform: lowercase;
}
.table-form textarea { min-height: 70px; resize: vertical; }
.two-col td:nth-child(1), .two-col td:nth-child(3) { width: 20%; }
.two-col td:nth-child(2), .two-col td:nth-child(4) { width: 30%; }

.address-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: clamp(.7rem,1.7vw,.85rem); }
.address-table td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: middle; }
.address-table .address-label { width: 42%; font-weight: 700; }
.address-table .address-value { width: 58%; }
.address-table input {
  width: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-weight: 500; text-transform: uppercase; padding: 4px 0;
}
.address-table input.has-value { font-weight: 700; }
.address-table input::placeholder { color: #9aa7b8; font-style: italic; text-transform: none; }

.medical-declaration-cell {
  padding: 12px 10px !important;
  vertical-align: top !important;
  position: relative;
}
.medical-declaration-text { font-size: .85rem; line-height: 1.7; margin-bottom: 6px; }
.medical-declaration-text .inline-field {
  display: inline-block;
  border-bottom: 1.5px solid #111;
  min-width: 260px;
  width: auto;
  max-width: 100%;
  padding: 0 6px 2px;
  vertical-align: bottom;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.medical-declaration-text .inline-field:focus-within {
  border-bottom-color: #0253C3;
  box-shadow: 0 3px 0 -1px rgba(2, 83, 195, 0.25);
}
.medical-declaration-text .inline-field input {
  border: 0; outline: 0; background: transparent;
  width: 100%;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  color: #063676;
  letter-spacing: 0.3px;
  padding: 2px 0;
}
.medical-declaration-text .inline-field input::placeholder {
  font-weight: 400;
  text-transform: none;
  font-style: italic;
  color: #9aa7b8;
  letter-spacing: 0;
}
.medical-declaration-note { margin: 10px 0 20px 0; font-size: .85rem; font-weight: 700; line-height: 1.5; }

.medical-signature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 30px;
}
.medical-signature-box { display: flex; flex-direction: column; gap: 4px; }
.medical-signature-box .sig-label { font-weight: 800; font-size: .85rem; }
.medical-signature-box .sig-input { border-bottom: 1px solid #111; min-height: 34px; padding: 4px 2px; }
.medical-signature-box .sig-input input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font: inherit; font-weight: 500; text-transform: uppercase;
}

.guardian-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.guardian-col { min-width: 0; }

/* ============================================================
   🏆 PROFESSIONAL GUARDIAN BLOCK — live progress + beautiful rows
============================================================ */
.guardian-col {
  position: relative;
  background: linear-gradient(155deg, #ffffff 0%, #f8fbff 60%, #fffdf5 100%);
  border: 2px solid #e3edf9;
  border-radius: 16px;
  padding: 14px 12px 12px;
  transition: all .35s cubic-bezier(.22,1,.36,1);
}
.guardian-col.is-active {
  border-color: rgba(2, 83, 195, 0.45);
  box-shadow:
    0 12px 32px -12px rgba(2, 83, 195, 0.28),
    0 0 0 3px rgba(2, 83, 195, 0.08);
}
.guardian-col.is-complete {
  border-color: rgba(131, 228, 115, 0.85);
  box-shadow:
    0 12px 32px -12px rgba(131, 228, 115, 0.4),
    0 0 0 3px rgba(131, 228, 115, 0.18);
  background: linear-gradient(155deg, #ffffff 0%, #f0fdf7 60%, #e8fbf1 100%);
}

/* Header strip on each block */
.guardian-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 10px;
  border-bottom: 1.5px dashed #d9e6ff;
  margin-bottom: 8px;
}
.guardian-header .guardian-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(.82rem, 2vw, .95rem);
  font-weight: 900;
  color: #063676;
  letter-spacing: .3px;
}
.guardian-header .guardian-title i {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .78rem;
  color: #ffffff;
  background: linear-gradient(135deg, #0253C3, #0247a8);
  box-shadow: 0 6px 14px -4px rgba(2, 83, 195, 0.5);
}
.guardian-col.is-complete .guardian-header .guardian-title i {
  background: linear-gradient(135deg, #83E473, #4fbf3a);
  box-shadow: 0 6px 14px -4px rgba(131, 228, 115, 0.7);
}

/* Live progress pill */
.guardian-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .5px;
  color: #5d6980;
  background: #ffffff;
  border: 1px solid #e3edf9;
  padding: 3px 10px;
  border-radius: 30px;
  transition: all .3s ease;
  white-space: nowrap;
}
.guardian-progress .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b0bcc9;
  transition: all .3s ease;
}
.guardian-col.is-active .guardian-progress {
  color: #0253C3;
  border-color: rgba(2, 83, 195, 0.35);
  background: #eaf3ff;
}
.guardian-col.is-active .guardian-progress .dot {
  background: #0253C3;
  box-shadow: 0 0 0 4px rgba(2, 83, 195, 0.15);
  animation: guardianDotPulse 1.4s ease-in-out infinite;
}
.guardian-col.is-complete .guardian-progress {
  color: #167a5b;
  border-color: rgba(131, 228, 115, 0.5);
  background: #eafbf1;
}
.guardian-col.is-complete .guardian-progress .dot {
  background: #4fbf3a;
  box-shadow: 0 0 0 4px rgba(131, 228, 115, 0.25);
}
@keyframes guardianDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: .7; }
}

/* Row styling inside guardian table */
.guardian-col .table-form {
  border-collapse: separate;
  border-spacing: 0;
}
.guardian-col .table-form tr { transition: background .25s ease; }
.guardian-col .table-form td {
  border: 1px solid #e3edf9;
  background: transparent;
  transition: background .25s ease, border-color .25s ease;
}
.guardian-col .table-form td:first-child {
  background: rgba(2, 83, 195, 0.03);
  font-weight: 800;
  color: #063676;
  width: 42%;
}
.guardian-col .table-form td.filled {
  background: linear-gradient(90deg, rgba(131, 228, 115, 0.12), rgba(131, 228, 115, 0.04));
  border-color: rgba(131, 228, 115, 0.45);
}
.guardian-col .table-form td.filled input {
  font-weight: 800;
  color: #0c5e3f;
  text-transform: uppercase;
}
.guardian-col .table-form input:focus {
  outline: none;
}
.guardian-col .table-form td:focus-within {
  background: rgba(253, 212, 19, 0.12);
  border-color: rgba(253, 212, 19, 0.75);
  box-shadow: inset 0 0 0 2px rgba(253, 212, 19, 0.25);
}

/* Small hint at the bottom */
.guardian-hint {
  margin-top: 10px;
  font-size: .7rem;
  font-weight: 700;
  font-style: italic;
  color: #7b8798;
  text-align: right;
  transition: color .3s ease;
}
.guardian-col.is-complete .guardian-hint {
  color: #167a5b;
}

/* Compact mode on mobile */
@media (max-width: 768px) {
  .guardian-col { padding: 12px 10px 10px; border-radius: 14px; }
  .guardian-header .guardian-title { font-size: .82rem; }
  .guardian-progress { font-size: .62rem; padding: 2px 8px; }
}

/* Responsive already collapses .guardian-row to 1 column on mobile */

/* Watermark */
.wm-wrapper { position: relative; }
.wm-wrapper::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 200px; height: 200px;
  transform: translate(-50%,-50%);
  background-image: url("images/logo.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: var(--wm-opacity);
  pointer-events: none;
  z-index: 0;
}
.wm-wrapper > * { position: relative; z-index: 1; }

/* Signature pad */
.signature-pad-wrapper {
  position: relative;
  width: 100%;
  height: 150px;
  border: 2px solid #e0e6ed;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: all .3s ease;
}
.signature-pad-wrapper:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(2,83,195,.12);
}
.signature-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.signature-placeholder {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  color: #cbd5e1;
  font-family: 'Brush Script MT','Segoe Script',cursive;
  font-size: 1.4rem;
  pointer-events: none;
  transition: opacity .3s;
  user-select: none;
  white-space: nowrap;
}
.signature-pad-wrapper.has-signature .signature-placeholder { opacity: 0; }
.sig-clear-btn {
  position: absolute; top: 8px; right: 8px;
  background: #f8f9fa; border: 1px solid #dee2e6;
  border-radius: 8px; padding: 5px 12px;
  font-size: .7rem; font-weight: 700; color: #495057;
  cursor: pointer; transition: all .2s;
  z-index: 10; display: flex; align-items: center; gap: 4px;
}
.sig-clear-btn:hover { background: #fff; color: var(--brand-red); border-color: var(--brand-red); }
.sig-clear-btn svg { width: 12px; height: 12px; }
.signature-pad-wrapper.compact { height: 120px; }

/* Docs / financial lists */
.docs {
  margin-top: 20px;
  padding: 14px 18px;
  background: #fff9d9;
  border-left: 6px solid var(--brand-yellow);
  border-radius: 12px;
  font-weight: 700;
  color: #5a3e00;
  font-size: .9rem;
}
.docs ul { margin: 8px 0 0 20px; }
.docs li { margin-bottom: 4px; }
.financial-list { margin: 12px 0 20px 22px; font-size: .9rem; line-height: 1.7; }
.financial-list li { margin-bottom: 8px; }

/* ============================================================
   UPLOAD SECTION
============================================================ */
.upload-section {
  background: linear-gradient(145deg, #ffffff 0%, #f3f9ff 60%, #fff9e6 100%);
  border-radius: 28px;
  padding: 2rem 1.5rem;
  margin-top: 2rem;
  border: 3px solid rgba(253,212,19,.4);
  box-shadow: 0 25px 50px -15px rgba(2,83,195,.15);
  position: relative;
  overflow: hidden;
}
.upload-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red), var(--brand-yellow), var(--brand-green));
}
.upload-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.upload-header-icon {
  width: 60px; height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.6rem;
  box-shadow: 0 10px 20px -8px rgba(2,83,195,.4);
  flex-shrink: 0;
}
.upload-header h3 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 900;
  color: var(--brand-blue);
  margin: 0;
}
.upload-header p {
  margin: 4px 0 0;
  color: #5d6980;
  font-weight: 600;
  font-size: .88rem;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.upload-card {
  position: relative;
  background: #fff;
  border: 3px dashed #d9e6ff;
  border-radius: 22px;
  padding: 1.3rem 1rem;
  text-align: center;
  transition: all .3s cubic-bezier(.175,.885,.32,1.275);
  cursor: pointer;
  overflow: hidden;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.upload-card:hover {
  transform: translateY(-6px);
  border-color: var(--brand-blue);
  box-shadow: 0 20px 40px -12px rgba(2,83,195,.25);
  background: #fafdff;
}
.upload-card.has-file {
  border-style: solid;
  border-color: var(--brand-green);
  background: linear-gradient(135deg, #f0fdf7, #e8fbf1);
}
.upload-card.has-file:hover { border-color: #5bc94a; }
.upload-card.error {
  border-color: var(--brand-red);
  animation: shake .4s ease;
  background: #fff5f5;
}
.upload-card-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eaf6ff, #d0ebff);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--brand-blue);
  transition: all .3s ease;
  flex-shrink: 0;
}
.upload-card:hover .upload-card-icon {
  transform: scale(1.1) rotate(-6deg);
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  color: #fff;
}
.upload-card.has-file .upload-card-icon {
  background: linear-gradient(135deg, var(--brand-green), #5bc94a);
  color: #fff;
  animation: checkPop .5s ease;
}
.upload-card-title {
  font-weight: 800;
  font-size: .92rem;
  color: #063676;
  line-height: 1.2;
}
.upload-card-sub {
  font-size: .72rem;
  font-weight: 700;
  color: #7b8798;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.upload-card-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--brand-red);
  color: #fff;
  font-weight: 900;
  font-size: .65rem;
  padding: 3px 9px;
  border-radius: 40px;
  letter-spacing: .5px;
}
.upload-card.has-file .upload-card-badge {
  background: var(--brand-green);
  color: #063676;
}
.upload-card-file {
  font-size: .75rem;
  font-weight: 700;
  color: #167a5b;
  margin-top: 4px;
  word-break: break-all;
  max-width: 100%;
  padding: 0 6px;
  line-height: 1.3;
}
.upload-card input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-summary {
  margin-top: 1.5rem;
  padding: 1rem 1.2rem;
  background: #fff;
  border-radius: 18px;
  border: 2px solid #eaf6ff;
  font-weight: 700;
  font-size: .85rem;
  color: #5d6980;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.upload-summary i { color: var(--brand-blue); }
.upload-summary .count { color: var(--brand-blue); font-weight: 900; }
.upload-summary.complete {
  background: linear-gradient(135deg, #f0fdf7, #e8fbf1);
  border-color: var(--brand-green);
}
.upload-summary.complete i { color: var(--brand-green); }

/* ============================================================
   SUBMIT BUTTON
============================================================ */
.submit-zone {
  margin-top: 2rem;
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f4faff 100%);
  border-radius: 28px;
  border: 3px solid rgba(2,83,195,.15);
  position: relative;
  overflow: hidden;
}
.submit-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 30%, rgba(253,212,19,.15), transparent 60%),
              radial-gradient(circle at 80% 70%, rgba(2,83,195,.1), transparent 60%);
  pointer-events: none;
}
.submit-zone > * { position: relative; z-index: 1; }

.btn-submit-application {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 1.1rem 3rem;
  border: none;
  border-radius: 60px;
  background: linear-gradient(135deg, var(--brand-red), #ff4d4d, var(--brand-coral));
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 10px 0 #b30000, 0 20px 40px -10px rgba(253,1,0,.5);
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
  overflow: hidden;
  text-transform: uppercase;
  min-width: 280px;
  max-width: 100%;
}
.btn-submit-application::before {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255,255,255,.35);
  transform: rotate(25deg);
  transition: left .7s ease;
  border-radius: 50%;
  pointer-events: none;
}
.btn-submit-application:hover:not(:disabled) {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 0 #b30000, 0 30px 60px -15px rgba(253,1,0,.7);
}
.btn-submit-application:hover:not(:disabled)::before { left: 120%; }
.btn-submit-application:active:not(:disabled) {
  transform: translateY(6px) scale(.98);
  box-shadow: 0 3px 0 #b30000;
}
.btn-submit-application:disabled {
  background: linear-gradient(135deg, #b0b0b0, #8a8a8a);
  box-shadow: 0 8px 0 #5c5c5c, 0 12px 25px -8px rgba(0,0,0,.3);
  cursor: not-allowed;
  transform: translateY(4px);
  opacity: .85;
}
.btn-submit-application .btn-submit-hint {
  display: block;
  width: 100%;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .5px;
  opacity: .95;
  margin-top: 3px;
  text-transform: none;
}
.btn-submit-application > * { position: relative; z-index: 2; }

.submit-requirements {
  margin-top: 1.5rem;
  color: #5d6980;
  font-weight: 700;
  font-size: .85rem;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  background: rgba(255,255,255,.7);
  padding: 1rem 1.4rem;
  border-radius: 18px;
  border: 2px solid #eaf6ff;
}
.submit-requirements .req {
  display: flex;
  align-items: center;
  gap: 8px;
}
.submit-requirements .req i {
  color: #b0b0b0;
  font-size: 1rem;
  transition: all .3s ease;
}
.submit-requirements .req.ok i { color: var(--brand-green); }
.submit-requirements .req.ok { color: #167a5b; }

/* ============================================================
   TOAST
============================================================ */
.app-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  padding: 1rem 2rem;
  border-radius: 60px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: .95rem;
  color: #fff;
  box-shadow: 0 15px 40px -10px rgba(0,0,0,.3);
  z-index: 99999;
  opacity: 0;
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  max-width: 90vw;
  text-align: center;
  pointer-events: none;
}
.app-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.app-toast.success { background: linear-gradient(135deg, var(--brand-blue), #0247a8); }
.app-toast.error { background: linear-gradient(135deg, var(--brand-red), #ff4d4d); }

/* ============================================================
   UPLOAD SOURCE CHOOSER — THE WORLD-SHOCKING FEATURE
============================================================ */
.upload-source-modal {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(6, 20, 46, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  opacity: 0;
  transition: opacity .35s ease;
}
.upload-source-modal.active {
  display: flex;
  opacity: 1;
}
.upload-source-modal.closing {
  opacity: 0;
}

.upload-source-panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 32px;
  padding: 2rem 1.6rem 1.6rem;
  background: linear-gradient(155deg, #ffffff 0%, #f4faff 55%, #fff9e6 100%);
  box-shadow:
    0 30px 70px -20px rgba(2, 83, 195, 0.5),
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 0 60px -10px rgba(253, 212, 19, 0.4);
  border: 3px solid rgba(253, 212, 19, 0.55);
  transform: translateY(28px) scale(0.94);
  opacity: 0;
  transition: transform .45s cubic-bezier(.175,.885,.32,1.275), opacity .35s ease;
  animation: modalGlowPulse 3.2s ease-in-out infinite;
}
.upload-source-modal.active .upload-source-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@keyframes modalGlowPulse {
  0%, 100% { box-shadow: 0 30px 70px -20px rgba(2,83,195,.5), 0 0 0 1px rgba(255,255,255,.6) inset, 0 0 60px -10px rgba(253,212,19,.4); }
  50%      { box-shadow: 0 30px 70px -20px rgba(2,83,195,.7), 0 0 0 1px rgba(255,255,255,.6) inset, 0 0 90px -6px rgba(253,212,19,.7); }
}

/* Rainbow top bar */
.upload-source-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red), var(--brand-yellow), var(--brand-green), var(--brand-blue));
  background-size: 200% 100%;
  animation: gradientFlow 2.4s linear infinite;
}

/* Close button */
.upload-source-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #5d6980;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(2,83,195,.3);
  transition: all .25s ease;
  z-index: 5;
}
.upload-source-close:hover {
  background: var(--brand-red);
  color: #fff;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 8px 22px -4px rgba(253,1,0,.5);
}

/* Header icon */
.upload-source-header {
  text-align: center;
  margin-bottom: 1.4rem;
}
.upload-source-header-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 12px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  box-shadow: 0 14px 30px -10px rgba(2,83,195,.5);
  animation: headerIconFloat 3s ease-in-out infinite;
}
@keyframes headerIconFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%      { transform: translateY(-8px) rotate(3deg); }
}
.upload-source-header h3 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #063676;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.upload-source-header p {
  font-size: .88rem;
  font-weight: 700;
  color: #5d6980;
  margin: 0;
}
.upload-source-header .upload-source-target {
  display: inline-block;
  margin-top: 6px;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--brand-red);
  background: #fff0f0;
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid rgba(253,1,0,.15);
}

/* Choice buttons */
.upload-source-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.upload-source-choice {
  position: relative;
  border: none;
  border-radius: 22px;
  padding: 1.4rem 1rem 1.2rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  transition: all .3s cubic-bezier(.175,.885,.32,1.275);
}
.upload-source-choice::before {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 50%; height: 200%;
  background: rgba(255,255,255,.45);
  transform: rotate(25deg);
  transition: left .7s ease;
  border-radius: 50%;
  pointer-events: none;
}
.upload-source-choice:hover::before { left: 130%; }

.upload-source-choice.camera {
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  color: #fff;
  box-shadow: 0 12px 0 #013a8a, 0 18px 30px -10px rgba(2,83,195,.5);
}
.upload-source-choice.camera:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 17px 0 #013a8a, 0 25px 45px -12px rgba(2,83,195,.7);
}
.upload-source-choice.camera:active {
  transform: translateY(6px) scale(.98);
  box-shadow: 0 3px 0 #013a8a;
}

.upload-source-choice.gallery {
  background: linear-gradient(135deg, var(--brand-green), #4fbf3a);
  color: #063676;
  box-shadow: 0 12px 0 #3f9a2e, 0 18px 30px -10px rgba(131,228,115,.5);
}
.upload-source-choice.gallery:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 17px 0 #3f9a2e, 0 25px 45px -12px rgba(131,228,115,.7);
}
.upload-source-choice.gallery:active {
  transform: translateY(6px) scale(.98);
  box-shadow: 0 3px 0 #3f9a2e;
}

.upload-source-choice .choice-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.4);
  transition: transform .35s ease;
}
.upload-source-choice.gallery .choice-icon {
  background: rgba(255,255,255,.5);
  border-color: rgba(255,255,255,.7);
  color: #063676;
}
.upload-source-choice:hover .choice-icon {
  transform: scale(1.15) rotate(-8deg);
}
.upload-source-choice .choice-label {
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: .3px;
}
.upload-source-choice .choice-sub {
  font-size: .72rem;
  font-weight: 700;
  opacity: .85;
  letter-spacing: .3px;
}
.upload-source-choice.camera .choice-sub { color: #cfe4ff; }
.upload-source-choice.gallery .choice-sub { color: #2a6b1f; }

/* Camera live view overlay */
.camera-live-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  flex-direction: column;
  background: #000;
  opacity: 0;
  transition: opacity .35s ease;
}
.camera-live-overlay.active {
  display: flex;
  opacity: 1;
}
.camera-live-stage {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}
.camera-live-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.camera-live-frame {
  position: absolute;
  inset: 6% 6%;
  border-radius: 26px;
  border: 3px dashed rgba(255,255,255,.55);
  pointer-events: none;
  animation: cameraFramePulse 2.2s ease-in-out infinite;
}
@keyframes cameraFramePulse {
  0%, 100% { border-color: rgba(255,255,255,.4); inset: 6% 6%; }
  50%      { border-color: rgba(253,212,19,.9); inset: 5% 5%; }
}
.camera-live-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--brand-yellow);
  border-style: solid;
  pointer-events: none;
}
.camera-live-corner.tl { top: 5%; left: 5%; border-width: 4px 0 0 4px; border-radius: 20px 0 0 0; }
.camera-live-corner.tr { top: 5%; right: 5%; border-width: 4px 4px 0 0; border-radius: 0 20px 0 0; }
.camera-live-corner.bl { bottom: 5%; left: 5%; border-width: 0 0 4px 4px; border-radius: 0 0 0 20px; }
.camera-live-corner.br { bottom: 5%; right: 5%; border-width: 0 4px 4px 0; border-radius: 0 0 20px 0; }

.camera-live-topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  padding: .9rem 1rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  background: linear-gradient(180deg, rgba(0,0,0,.75), transparent);
  z-index: 3;
}
.camera-live-topbar .cam-title {
  color: #fff;
  font-weight: 900;
  font-size: .9rem;
  letter-spacing: .4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.camera-live-topbar .cam-title i { color: var(--brand-yellow); }
.camera-live-topbar .cam-timer {
  margin-left: auto;
  color: #fff;
  font-weight: 800;
  font-size: .8rem;
  background: rgba(255,255,255,.18);
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,.25);
}

.camera-live-bottombar {
  flex: 0 0 auto;
  padding: 1.4rem 1rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: linear-gradient(0deg, rgba(0,0,0,.95), rgba(0,0,0,.55));
  gap: 1rem;
}
.cam-action-btn {
  border: none;
  border-radius: 50%;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
  box-shadow: 0 8px 22px -6px rgba(0,0,0,.6);
}
.cam-action-btn.cancel {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 2px solid rgba(255,255,255,.35);
}
.cam-action-btn.cancel:hover {
  background: var(--brand-red);
  border-color: var(--brand-red);
  transform: scale(1.08);
}
.cam-action-btn.switch {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 2px solid rgba(255,255,255,.35);
}
.cam-action-btn.switch:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  transform: scale(1.08) rotate(-25deg);
}
.cam-action-btn.snap {
  width: 84px;
  height: 84px;
  background: linear-gradient(135deg, var(--brand-red), var(--brand-coral));
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px rgba(253,1,0,.4), 0 12px 30px -6px rgba(253,1,0,.7);
  animation: snapPulse 2s infinite;
}
.cam-action-btn.snap:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 6px rgba(253,1,0,.55), 0 16px 40px -6px rgba(253,1,0,.9);
}
.cam-action-btn.snap:active {
  transform: scale(0.94);
}
@keyframes snapPulse {
  0%   { box-shadow: 0 0 0 4px rgba(253,1,0,.4), 0 12px 30px -6px rgba(253,1,0,.7); }
  50%  { box-shadow: 0 0 0 12px rgba(253,1,0,0), 0 12px 30px -6px rgba(253,1,0,.7); }
  100% { box-shadow: 0 0 0 4px rgba(253,1,0,.4), 0 12px 30px -6px rgba(253,1,0,.7); }
}

/* Camera fallback message */
.camera-live-fallback {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fff;
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, #013a8a, #0253C3);
  z-index: 4;
}
.camera-live-fallback.show { display: flex; }
.camera-live-fallback i {
  font-size: 3rem;
  color: var(--brand-yellow);
}
.camera-live-fallback h4 {
  font-weight: 900;
  font-size: 1.2rem;
  margin: 0;
}
.camera-live-fallback p {
  font-size: .88rem;
  font-weight: 600;
  opacity: .9;
  max-width: 320px;
  margin: 0;
}
.camera-live-fallback .fallback-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
.camera-live-fallback .fallback-actions button {
  border: none;
  border-radius: 40px;
  padding: .7rem 1.3rem;
  font-weight: 800;
  font-size: .85rem;
  cursor: pointer;
  transition: transform .2s ease;
}
.camera-live-fallback .fallback-actions .fb-gallery {
  background: var(--brand-green);
  color: #063676;
}
.camera-live-fallback .fallback-actions .fb-cancel {
  background: rgba(255,255,255,.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,.4);
}
.camera-live-fallback .fallback-actions button:hover {
  transform: translateY(-3px);
}

/* Shutter flash */
.camera-shutter-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 100000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}
.camera-shutter-flash.fire { opacity: 1; }

/* ============================================================
   UPLOAD CARD ACTION ICONS (View + Delete)
============================================================ */
.upload-card-actions {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  gap: 8px;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: all .35s cubic-bezier(.175,.885,.32,1.275);
}
.upload-card.has-file .upload-card-actions {
  opacity: 1;
  transform: translateY(0);
}
.upload-card-action {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  color: var(--brand-blue);
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -6px rgba(2,83,195,.45), 0 0 0 1px rgba(255,255,255,.4) inset;
  transition: all .3s cubic-bezier(.175,.885,.32,1.275);
}
.upload-card-action:hover {
  transform: translateY(-4px) scale(1.12);
  box-shadow: 0 12px 26px -6px rgba(2,83,195,.6), 0 0 0 1px rgba(255,255,255,.6) inset;
}
.upload-card-action:active {
  transform: translateY(0) scale(.96);
}
.upload-card-action.view {
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(234,246,255,.95));
  color: var(--brand-blue);
}
.upload-card-action.view:hover {
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  color: #fff;
  border-color: var(--brand-yellow);
}
.upload-card-action.delete {
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,240,240,.95));
  color: var(--brand-red);
}
.upload-card-action.delete:hover {
  background: linear-gradient(135deg, var(--brand-red), #ff4d4d);
  color: #fff;
  border-color: var(--brand-yellow);
  box-shadow: 0 12px 26px -6px rgba(253,1,0,.6), 0 0 0 1px rgba(255,255,255,.6) inset;
}
.upload-card-action .action-tooltip {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #063676;
  color: #fff;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: .65rem;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all .25s ease;
  box-shadow: 0 6px 16px -4px rgba(2,83,195,.5);
}
.upload-card-action .action-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #063676;
}
.upload-card-action:hover .action-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Small thumbnail preview behind the icon area when file uploaded */
.upload-card-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity .5s ease;
  z-index: 0;
  border-radius: 19px;
}
.upload-card.has-file .upload-card-thumb { opacity: 0.12; }

/* ============================================================
   IMAGE PREVIEW MODAL — CINEMATIC FULLSCREEN
============================================================ */
.image-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 10, 26, 0.92);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  opacity: 0;
  transition: opacity .4s ease;
}
.image-preview-modal.active {
  display: flex;
  opacity: 1;
}

.image-preview-frame {
  position: relative;
  width: 100%;
  max-width: 1000px;
  max-height: 92vh;
  border-radius: 28px;
  padding: 1.2rem;
  background: linear-gradient(155deg, #ffffff 0%, #f4faff 55%, #fff9e6 100%);
  box-shadow:
    0 40px 90px -20px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255,255,255,0.6) inset,
    0 0 80px -10px rgba(253, 212, 19, 0.5);
  border: 3px solid rgba(253, 212, 19, 0.6);
  transform: translateY(28px) scale(0.94);
  opacity: 0;
  transition: transform .45s cubic-bezier(.175,.885,.32,1.275), opacity .35s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: previewGlowPulse 4s ease-in-out infinite;
}
.image-preview-modal.active .image-preview-frame {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@keyframes previewGlowPulse {
  0%, 100% { box-shadow: 0 40px 90px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.6) inset, 0 0 80px -10px rgba(253,212,19,.5); }
  50%      { box-shadow: 0 40px 90px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.6) inset, 0 0 120px -6px rgba(2,83,195,.7); }
}
.image-preview-frame::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-red), var(--brand-yellow), var(--brand-green), var(--brand-blue));
  background-size: 200% 100%;
  animation: gradientFlow 2.4s linear infinite;
}

/* Header of preview */
.image-preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 .4rem .8rem;
  flex-wrap: wrap;
}
.image-preview-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--brand-red);
  background: #fff0f0;
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid rgba(253,1,0,.15);
  flex-shrink: 0;
}
.image-preview-badge i { font-size: .8rem; }
.image-preview-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #063676;
  letter-spacing: -.3px;
  margin: 0;
  flex: 1 1 200px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.image-preview-controls {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.image-preview-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #063676;
  font-size: .95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(2,83,195,.3);
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
}
.image-preview-btn:hover {
  transform: translateY(-3px) scale(1.1);
  color: #fff;
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  box-shadow: 0 10px 22px -4px rgba(2,83,195,.5);
}
.image-preview-btn:active {
  transform: translateY(0) scale(.95);
}
.image-preview-btn.close-btn {
  background: linear-gradient(135deg, var(--brand-red), #ff4d4d);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(253,1,0,.5);
}
.image-preview-btn.close-btn:hover {
  transform: translateY(-3px) scale(1.12) rotate(90deg);
  box-shadow: 0 10px 26px -4px rgba(253,1,0,.8);
}

/* The image viewport */
.image-preview-stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 20%, rgba(2,83,195,.08), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(253,212,19,.1), transparent 60%),
    repeating-conic-gradient(from 0deg, #f4faff 0deg 15deg, #eaf6ff 15deg 30deg);
  min-height: 260px;
  max-height: 70vh;
  padding: 1rem;
}
.image-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.5), 0 0 0 4px #fff;
  transition: transform .35s cubic-bezier(.175,.885,.32,1.275);
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
}

/* 📄 PDF viewer inside the preview modal — fills the stage */
.image-preview-pdf {
  width: 100%;
  height: 100%;
  min-height: 260px;
  max-height: 70vh;
  border: none;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 20px 50px -12px rgba(0,0,0,.5), 0 0 0 4px #fff;
  display: block;
}

/* When the PDF is showing, allow the stage to use all its height */
.image-preview-stage.pdf-mode {
  padding: 0;
  background: #eef4fb;
}

/* Hides zoom/rotate buttons that don't apply to PDFs */
.image-preview-controls.pdf-mode .image-preview-btn.zoom-btn,
.image-preview-controls.pdf-mode .image-preview-btn.rotate-btn {
  display: none;
}

/* Mobile PDF sizing */
@media (max-width: 768px) {
  .image-preview-pdf {
    min-height: 200px;
    max-height: 60vh;
    border-radius: 10px;
  }
}

/* Footer */
.image-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: .9rem .4rem 0;
  flex-wrap: wrap;
}
.image-preview-meta {
  font-size: .75rem;
  font-weight: 800;
  color: #5d6980;
  letter-spacing: .3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.image-preview-meta .meta-label {
  color: #063676;
  font-weight: 900;
  text-transform: uppercase;
  font-size: .65rem;
  letter-spacing: .8px;
  margin-right: 6px;
}
.image-preview-delete-btn {
  border: none;
  border-radius: 30px;
  padding: .65rem 1.3rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-red), #ff4d4d);
  box-shadow: 0 8px 0 #b30000, 0 12px 26px -8px rgba(253,1,0,.5);
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
}
.image-preview-delete-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 11px 0 #b30000, 0 18px 34px -10px rgba(253,1,0,.7);
}
.image-preview-delete-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #b30000;
}

/* Empty state inside preview (fallback) */
.image-preview-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #5d6980;
  text-align: center;
  padding: 2rem;
}
.image-preview-empty i {
  font-size: 3rem;
  color: var(--brand-blue);
  opacity: .6;
}
.image-preview-empty.show { display: flex; }
.image-preview-empty p {
  font-weight: 700;
  font-size: .9rem;
  margin: 0;
}

/* Rotate transform classes */
.image-preview-img.rot-90  { transform: rotate(90deg)  scale(var(--zoom, 1)); }
.image-preview-img.rot-180 { transform: rotate(180deg) scale(var(--zoom, 1)); }
.image-preview-img.rot-270 { transform: rotate(270deg) scale(var(--zoom, 1)); }
.image-preview-img.zoom-in   { --zoom: 1.5; transform: scale(1.5); }
.image-preview-img.zoom-in.rot-90  { transform: rotate(90deg)  scale(1.5); }
.image-preview-img.zoom-in.rot-180 { transform: rotate(180deg) scale(1.5); }
.image-preview-img.zoom-in.rot-270 { transform: rotate(270deg) scale(1.5); }

/* Image preview responsive */
@media (max-width: 768px) {
  .image-preview-frame {
    padding: 1rem;
    border-radius: 22px;
    max-height: 96vh;
  }
  .image-preview-header {
    gap: 8px;
    padding: 0 .2rem .7rem;
  }
  .image-preview-title {
    font-size: .9rem;
    flex-basis: 100%;
  }
  .image-preview-controls {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .image-preview-btn { width: 36px; height: 36px; font-size: .85rem; }
  .image-preview-stage {
    min-height: 200px;
    max-height: 60vh;
    padding: .6rem;
  }
  .image-preview-delete-btn {
    padding: .55rem 1rem;
    font-size: .78rem;
  }
  .image-preview-meta { font-size: .68rem; }
}

@media (max-width: 480px) {
  .upload-card-action { width: 36px; height: 36px; font-size: .85rem; }
  .upload-card-action .action-tooltip { font-size: .6rem; padding: 3px 8px; bottom: 46px; }
  .image-preview-frame { padding: .8rem; }
  .image-preview-badge { font-size: .6rem; padding: 3px 9px; }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  .app-topbar { padding: .6rem .8rem; gap: .6rem; }
  .app-topbar-brand span { display: none; }
  .app-topbar-brand img { height: 36px; }
  .btn-back-home { padding: .5rem 1rem; font-size: .8rem; }
  .btn-back-home .btn-text { display: none; }
  .app-hero { padding: 2.5rem 1rem 2rem; }
  .app-hero-logo img { height: 80px; }
  .app-main { padding: 1.5rem .7rem 3rem; }
  .form-page { padding: 16px 14px 0; border-radius: 18px; }
  .page-header { grid-template-columns: 90px 1fr; gap: 12px; }
  .logo { max-width: 90px; }
  .guardian-row { grid-template-columns: 1fr; }
  .medical-signature-row { grid-template-columns: 1fr; gap: 16px; }
  .address-table .address-label { width: 45%; }
  .address-table .address-value { width: 55%; }
  .medical-declaration-text .inline-field { min-width: 200px; }
  .medical-declaration-text { font-size: .82rem; line-height: 1.85; }
  .btn-submit-application {
    padding: .95rem 1.5rem;
    font-size: 1rem;
    min-width: 0;
    width: 100%;
  }
  .upload-section { padding: 1.5rem 1rem; }
  .upload-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .upload-card { padding: 1rem .6rem; min-height: 160px; }
  .upload-card-icon { width: 48px; height: 48px; font-size: 1.2rem; }
  .upload-card-title { font-size: .8rem; }
}

@media (max-width: 480px) {
  .upload-grid { grid-template-columns: 1fr; }
  .page-header { grid-template-columns: 1fr; text-align: center; }
  .logo { max-width: 100px; margin: 0 auto; }
  .rocket-corner { margin: 6px auto 0; }
  .medical-declaration-text .inline-field { min-width: 140px; }
  .medical-declaration-text { font-size: .8rem; line-height: 1.9; }
  .signature-placeholder { font-size: 1rem; }
  .app-instructions { flex-direction: column; }
  .app-instructions i { align-self: center; }

  /* Upload source chooser — mobile tuning */
  .upload-source-panel { padding: 1.6rem 1.1rem 1.2rem; border-radius: 26px; }
  .upload-source-header-icon { width: 64px; height: 64px; font-size: 1.6rem; border-radius: 20px; }
  .upload-source-header h3 { font-size: 1.15rem; }
  .upload-source-header p { font-size: .8rem; }
  .upload-source-choices { gap: 10px; }
  .upload-source-choice { padding: 1.1rem .6rem 1rem; border-radius: 18px; }
  .upload-source-choice .choice-icon { width: 48px; height: 48px; font-size: 1.25rem; }
  .upload-source-choice .choice-label { font-size: .9rem; }
  .upload-source-choice .choice-sub { font-size: .65rem; }

  .cam-action-btn { width: 54px; height: 54px; font-size: 1.2rem; }
  .cam-action-btn.snap { width: 74px; height: 74px; }
  .camera-live-bottombar { padding: 1.1rem .8rem 1.3rem; }
}

@media print {
  body { background: #fff; }
  .app-topbar, .app-hero, .upload-section, .submit-zone, .app-instructions, .sig-clear-btn,
  .upload-source-modal, .camera-live-overlay, .camera-shutter-flash, .image-preview-modal,
  .upload-card-actions {
    display: none !important;
  }
  .app-main { padding: 0; }
  .form-page {
    box-shadow: none;
    border-radius: 0;
    border: none;
    margin: 0 0 12px;
    page-break-after: always;
  }
}

/* ============================================================
   EXTRA: BEAUTIFUL CLICK INSTRUCTION (for all upload boxes)
============================================================ */
.upload-card-click-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #6b8cae;
  background: rgba(2, 83, 195, 0.06);
  padding: 4px 12px;
  border-radius: 40px;
  border: 1px dashed rgba(2, 83, 195, 0.25);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  margin-top: 2px;
  animation: instructionPulse 2.4s ease-in-out infinite;
}
.upload-card-click-instruction i {
  font-size: 0.75rem;
  color: var(--brand-blue);
  opacity: 0.8;
}
.upload-card:hover .upload-card-click-instruction {
  background: rgba(2, 83, 195, 0.12);
  border-color: rgba(2, 83, 195, 0.5);
  color: var(--brand-blue);
  transform: scale(1.02);
}
.upload-card.has-file .upload-card-click-instruction {
  background: rgba(131, 228, 115, 0.15);
  border-color: rgba(131, 228, 115, 0.5);
  color: #167a5b;
}
.upload-card.has-file .upload-card-click-instruction i {
  color: #167a5b;
}
@keyframes instructionPulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.03); }
}

/* ============================================================
   🎬 SUBMIT PROGRESS OVERLAY — THE WORLD'S MOST BEAUTIFUL LOADER
   ------------------------------------------------------------
   A cinematic, multi-stage loading overlay that plays the moment
   the user clicks "Submit Application".
   Fully responsive, accessible, and delightfully animated.
   ============================================================ */
.submit-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 100003;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity .4s ease;
}
.submit-progress-overlay.active {
  display: flex;
  opacity: 1;
}
.submit-progress-overlay.closing {
  opacity: 0;
}

/* ── Backdrop ── */
.submit-progress-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(2,83,195,.55), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(253,212,19,.45), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(131,228,115,.3), transparent 65%),
    rgba(2, 10, 26, 0.85);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  animation: submitBackdropPulse 6s ease-in-out infinite;
}
@keyframes submitBackdropPulse {
  0%, 100% { background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%; }
  50%      { background-size: 130% 130%, 130% 130%, 130% 130%, 100% 100%; }
}

/* ── Aurora blobs floating behind the panel ── */
.submit-progress-aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.submit-progress-aurora span {
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .55;
  animation: auroraFloat 14s ease-in-out infinite;
}
.submit-progress-aurora span:nth-child(1) {
  background: radial-gradient(circle, #0253C3, transparent 70%);
  top: -10%; left: -10%;
  animation-delay: 0s;
}
.submit-progress-aurora span:nth-child(2) {
  background: radial-gradient(circle, #FDD413, transparent 70%);
  bottom: -15%; right: -10%;
  animation-delay: 4s;
}
.submit-progress-aurora span:nth-child(3) {
  background: radial-gradient(circle, #83E473, transparent 70%);
  top: 40%; left: 50%;
  width: 360px; height: 360px;
  animation-delay: 8s;
}
@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.15); }
  66%      { transform: translate(-30px, 40px) scale(0.9); }
}

/* ── Panel ── */
.submit-progress-panel {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 36px;
  padding: 2.6rem 2rem 2rem;
  background:
    linear-gradient(155deg, #ffffff 0%, #f4faff 45%, #fff9e6 100%);
  box-shadow:
    0 60px 140px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255,255,255,0.7) inset,
    0 0 140px -20px rgba(2, 83, 195, 0.85),
    0 0 260px -40px rgba(253, 212, 19, 0.75);
  border: 3px solid rgba(2, 83, 195, 0.7);
  transform: translateY(60px) scale(0.9);
  opacity: 0;
  transition: transform .55s cubic-bezier(.175,.885,.32,1.275), opacity .4s ease;
  animation: submitPanelGlow 5s ease-in-out infinite;
  scrollbar-width: thin;
  scrollbar-color: rgba(2,83,195,.4) transparent;
  text-align: center;
}
.submit-progress-panel::-webkit-scrollbar { width: 8px; }
.submit-progress-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-green));
  border-radius: 10px;
}
.submit-progress-overlay.active .submit-progress-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@keyframes submitPanelGlow {
  0%, 100% {
    box-shadow:
      0 60px 140px -30px rgba(0,0,0,.9),
      0 0 0 1px rgba(255,255,255,.7) inset,
      0 0 140px -20px rgba(2,83,195,.85),
      0 0 260px -40px rgba(253,212,19,.75);
  }
  50% {
    box-shadow:
      0 60px 140px -30px rgba(0,0,0,.9),
      0 0 0 1px rgba(255,255,255,.7) inset,
      0 0 200px -20px rgba(2,83,195,.95),
      0 0 320px -40px rgba(253,212,19,.95);
  }
}

/* ── Rainbow animated top ribbon ── */
.submit-progress-ribbon {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  border-radius: 36px 36px 0 0;
  background: linear-gradient(
    90deg,
    var(--brand-blue), var(--brand-red), var(--brand-yellow),
    var(--brand-green), var(--brand-coral), var(--brand-blue));
  background-size: 300% 100%;
  animation: gradientFlow 2.4s linear infinite;
}

/* ─────────── SPINNER STAGE ─────────── */
.submit-spinner-stage {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Concentric rotating rings */
.submit-spinner-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.submit-spinner-ring-1 {
  inset: 0;
  border: 3px dashed rgba(2, 83, 195, 0.35);
  animation: spin 14s linear infinite;
}
.submit-spinner-ring-2 {
  inset: 20px;
  border: 3px dotted rgba(253, 212, 19, 0.7);
  animation: spin 9s linear infinite reverse;
}
.submit-spinner-ring-3 {
  inset: 42px;
  border: 3px dashed rgba(131, 228, 115, 0.7);
  animation: spin 6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Orbiting icon rings */
.submit-orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.submit-orbit-a { animation: spin 10s linear infinite; }
.submit-orbit-b { inset: 30px; animation: spin 7s linear infinite reverse; }

.submit-orbit-item {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #eaf3ff);
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  font-size: .8rem;
  box-shadow:
    0 8px 18px -4px rgba(2,83,195,.55),
    0 0 0 3px rgba(2,83,195,.12);
  top: -16px; left: 50%;
  transform: translateX(-50%);
}
/* Distribute 4 orbit items on ring A */
.submit-orbit-a .submit-orbit-item:nth-child(1) { top: -16px; left: 50%; }
.submit-orbit-a .submit-orbit-item:nth-child(2) { top: 50%; left: calc(100% - 16px); }
.submit-orbit-a .submit-orbit-item:nth-child(3) { top: calc(100% - 16px); left: 50%; }
.submit-orbit-a .submit-orbit-item:nth-child(4) { top: 50%; left: -16px; }

/* Distribute 3 orbit items on ring B */
.submit-orbit-b .submit-orbit-item:nth-child(1) { top: -16px; left: 50%; }
.submit-orbit-b .submit-orbit-item:nth-child(2) {
  top: calc(75% - 8px);
  left: calc(93% - 16px);
}
.submit-orbit-b .submit-orbit-item:nth-child(3) {
  top: calc(75% - 8px);
  left: calc(7% - 16px);
}
.submit-orbit-b .submit-orbit-item {
  background: linear-gradient(135deg, #FDD413, #ffb800);
  color: #063676;
  border-color: #fff;
}

/* Centre core with pulsing shockwaves */
.submit-spinner-core {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.submit-spinner-core-inner {
  position: relative;
  z-index: 3;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--brand-blue), #0247a8 60%, var(--brand-green));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2rem;
  box-shadow:
    0 18px 40px -12px rgba(2,83,195,.85),
    0 0 0 8px rgba(255,255,255,.9),
    0 0 0 16px rgba(2,83,195,.15);
  animation: corePulse 2s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { transform: scale(1) rotate(-3deg); }
  50%      { transform: scale(1.08) rotate(3deg); }
}
.submit-spinner-core-inner i {
  animation: coreIconFloat 3s ease-in-out infinite;
}
@keyframes coreIconFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-4px) rotate(-8deg); }
}

/* Pulsing shockwaves from the core */
.submit-spinner-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  border: 2px solid rgba(2, 83, 195, 0.55);
  animation: coreShockwave 2.6s ease-out infinite;
  pointer-events: none;
}
.submit-pulse-2 { animation-delay: .9s; border-color: rgba(253, 212, 19, 0.65); }
.submit-pulse-3 { animation-delay: 1.8s; border-color: rgba(131, 228, 115, 0.65); }
@keyframes coreShockwave {
  0%   { transform: scale(1);    opacity: .85; }
  100% { transform: scale(1.9);  opacity: 0; }
}

/* Sparkles */
.submit-sparkle {
  position: absolute;
  font-size: 1.2rem;
  animation: sparkleSpin 2s ease-in-out infinite;
  pointer-events: none;
}
.submit-sparkle-1 { top: 6%;  left: 6%;   color: var(--brand-yellow); animation-delay: 0s; }
.submit-sparkle-2 { top: 10%; right: 4%;  color: var(--brand-coral);  animation-delay: .4s; }
.submit-sparkle-3 { bottom: 8%; left: 8%; color: var(--brand-green);  animation-delay: .8s; }
.submit-sparkle-4 { bottom: 6%; right: 6%; color: var(--brand-blue);   animation-delay: 1.2s; }
@keyframes sparkleSpin {
  0%, 100% { opacity: .25; transform: scale(0.7) rotate(0deg); }
  50%      { opacity: 1;   transform: scale(1.35) rotate(180deg); }
}

/* ─────────── TITLES ─────────── */
.submit-progress-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(1.3rem, 3.6vw, 1.75rem);
  letter-spacing: -0.4px;
  line-height: 1.15;
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green) 50%, var(--brand-blue));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 4s linear infinite;
}
.submit-progress-subtitle {
  font-size: .9rem;
  font-weight: 700;
  color: #5d6980;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto 1.5rem;
}

/* ─────────── LIVE STAGE LABEL ─────────── */
.submit-progress-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: .7rem 1.1rem;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #eaf3ff, #d5e8ff);
  border: 2px solid rgba(2, 83, 195, 0.35);
  border-radius: 40px;
  max-width: fit-content;
  font-weight: 900;
  font-size: .88rem;
  color: #0253C3;
  transition: all .35s ease;
}
.submit-progress-stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #0253C3;
  box-shadow: 0 0 0 4px rgba(2, 83, 195, 0.2);
  animation: stageDotPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes stageDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: .7; }
}
.submit-progress-stage-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.submit-progress-stage-percent {
  font-variant-numeric: tabular-nums;
  min-width: 46px;
  text-align: right;
  font-weight: 900;
  color: #063676;
  font-size: .95rem;
}

/* ─────────── PROGRESS BAR ─────────── */
.submit-progress-bar-wrap {
  position: relative;
  margin: 0 0 1.5rem;
}
.submit-progress-bar-track {
  position: relative;
  width: 100%;
  height: 16px;
  background: rgba(2, 83, 195, 0.12);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.08);
}
.submit-progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 20px;
  background: linear-gradient(
    90deg,
    var(--brand-blue) 0%,
    var(--brand-red) 25%,
    var(--brand-yellow) 50%,
    var(--brand-green) 75%,
    var(--brand-blue) 100%);
  background-size: 200% 100%;
  animation: gradientFlow 1.8s linear infinite;
  transition: width .55s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 0 18px rgba(2, 83, 195, 0.4);
  position: relative;
  z-index: 2;
}
/* Travelling shimmer inside the fill */
.submit-progress-bar-shimmer {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255,255,255,.45) 50%,
    transparent 70%);
  background-size: 200% 100%;
  animation: shimmerSweep 2.2s linear infinite;
  z-index: 3;
  pointer-events: none;
}
@keyframes shimmerSweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}
/* Glow that follows the leading edge of the fill */
.submit-progress-bar-glow {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #FDD413 0%, rgba(253,212,19,.5) 40%, transparent 70%);
  filter: blur(2px);
  pointer-events: none;
  transition: left .55s cubic-bezier(.22,1,.36,1);
  animation: glowPulse 1.6s ease-in-out infinite;
  z-index: 4;
}
@keyframes glowPulse {
  0%, 100% { opacity: .8; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;  transform: translate(-50%, -50%) scale(1.3); }
}

/* ─────────── STAGE TICK MARKS ─────────── */
.submit-progress-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 1.4rem;
  padding: 0 4px;
}
.submit-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  transition: all .35s ease;
}
.submit-step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef4fb;
  border: 2px solid #d9e6ff;
  color: #b0bcc9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
  position: relative;
}
.submit-step-dot i {
  opacity: 0;
  transform: scale(0.4);
  transition: all .4s cubic-bezier(.175,.885,.32,1.275);
}
.submit-step-label {
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #7b8798;
  text-align: center;
  line-height: 1.15;
  transition: color .35s ease;
  word-break: break-word;
  max-width: 100%;
}
/* Active step */
.submit-progress-step.is-active .submit-step-dot {
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  border-color: var(--brand-yellow);
  color: #fff;
  box-shadow:
    0 8px 22px -4px rgba(2,83,195,.75),
    0 0 0 6px rgba(2,83,195,.15);
  animation: stepDotActive 1.4s ease-in-out infinite;
}
.submit-progress-step.is-active .submit-step-label {
  color: var(--brand-blue);
}
@keyframes stepDotActive {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}
/* Completed step */
.submit-progress-step.is-done .submit-step-dot {
  background: linear-gradient(135deg, var(--brand-green), #4fbf3a);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow:
    0 8px 22px -4px rgba(131,228,115,.75),
    0 0 0 5px rgba(131,228,115,.22);
}
.submit-progress-step.is-done .submit-step-dot i {
  opacity: 1;
  transform: scale(1);
}
.submit-progress-step.is-done .submit-step-label {
  color: #167a5b;
}

/* ─────────── FOOTER HINT ─────────── */
.submit-progress-hint {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .3px;
  color: #7b8798;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.submit-progress-hint i {
  color: var(--brand-green);
  animation: lockBounce 2s ease-in-out infinite;
}
@keyframes lockBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 520px) {
  .submit-progress-overlay { padding: .5rem; align-items: flex-end; }
  .submit-progress-panel {
    padding: 2rem 1.2rem 1.4rem;
    border-radius: 28px 28px 0 0;
    max-width: 100%;
    max-height: 96vh;
  }
  .submit-progress-ribbon { border-radius: 28px 28px 0 0; }
  .submit-spinner-stage { width: 180px; height: 180px; margin-bottom: 1.2rem; }
  .submit-spinner-core-inner { width: 70px; height: 70px; font-size: 1.7rem; border-radius: 20px; }
  .submit-spinner-ring-2 { inset: 16px; }
  .submit-spinner-ring-3 { inset: 34px; }
  .submit-orbit-b { inset: 24px; }
  .submit-orbit-item { width: 26px; height: 26px; font-size: .68rem; top: -13px; }
  .submit-orbit-a .submit-orbit-item:nth-child(2) { top: 50%; left: calc(100% - 13px); }
  .submit-orbit-a .submit-orbit-item:nth-child(3) { top: calc(100% - 13px); left: 50%; }
  .submit-orbit-a .submit-orbit-item:nth-child(4) { top: 50%; left: -13px; }
  .submit-progress-title { font-size: 1.2rem; }
  .submit-progress-subtitle { font-size: .82rem; margin-bottom: 1.2rem; }
  .submit-progress-stage { font-size: .78rem; padding: .55rem .9rem; gap: 8px; }
  .submit-progress-stage-percent { font-size: .85rem; }
  .submit-progress-bar-track { height: 14px; }
  .submit-step-dot { width: 26px; height: 26px; font-size: .62rem; }
  .submit-step-label { font-size: .55rem; }
  .submit-progress-steps { gap: 4px; }
}
@media (max-width: 380px) {
  .submit-progress-panel { padding: 1.6rem 1rem 1.1rem; }
  .submit-spinner-stage { width: 160px; height: 160px; }
  .submit-spinner-core-inner { width: 62px; height: 62px; font-size: 1.5rem; }
  .submit-progress-title { font-size: 1.1rem; }
  .submit-progress-subtitle { font-size: .78rem; }
  .submit-step-label { font-size: .5rem; }
}

/* ─────────── REDUCED MOTION ─────────── */
@media (prefers-reduced-motion: reduce) {
  .submit-progress-backdrop,
  .submit-progress-aurora span,
  .submit-spinner-ring,
  .submit-orbit,
  .submit-spinner-core-inner,
  .submit-spinner-core-inner i,
  .submit-spinner-pulse,
  .submit-sparkle,
  .submit-progress-stage-dot,
  .submit-progress-bar-fill,
  .submit-progress-bar-shimmer,
  .submit-progress-bar-glow,
  .submit-progress-step.is-active .submit-step-dot,
  .submit-progress-hint i,
  .submit-progress-panel,
  .submit-progress-ribbon {
    animation: none !important;
  }
}

/* ─────────── PRINT ─────────── */
@media print {
  .submit-progress-overlay { display: none !important; }
}

/* ============================================================
   🚨 DUPLICATE APPLICATION MODAL
   ------------------------------------------------------------
   The world's most beautiful "we already have this" screen.
   • Fully responsive (mobile → ultrawide)
   • Animated aurora background + confetti shimmer
   • Status-aware color theming
     - Pending  → brand blue
     - Approved → brand green
     - Rejected → brand coral/red
   ============================================================ */
.duplicate-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(2,83,195,.45), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(253,212,19,.4), transparent 55%),
    radial-gradient(circle at 50% 50%, rgba(131,228,115,.25), transparent 65%),
    rgba(2, 10, 26, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  opacity: 0;
  transition: opacity .5s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.duplicate-modal.active { display: flex; opacity: 1; }

.duplicate-modal-frame {
  position: relative;
  width: 100%;
  max-width: 620px;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 36px;
  padding: 2.4rem 2rem 2rem;
  background:
    linear-gradient(155deg, #ffffff 0%, #f4faff 45%, #fff9e6 100%);
  box-shadow:
    0 50px 120px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255,255,255,0.7) inset,
    0 0 120px -20px rgba(2, 83, 195, 0.8),
    0 0 220px -40px rgba(253, 212, 19, 0.7);
  border: 3px solid rgba(2, 83, 195, 0.7);
  transform: translateY(60px) scale(0.85);
  opacity: 0;
  transition: transform .65s cubic-bezier(.175,.885,.32,1.275), opacity .4s ease;
  animation: duplicateGlow 5s ease-in-out infinite;
  scrollbar-width: thin;
  scrollbar-color: rgba(2,83,195,.4) transparent;
}
.duplicate-modal-frame::-webkit-scrollbar { width: 8px; }
.duplicate-modal-frame::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-green));
  border-radius: 10px;
}
.duplicate-modal.active .duplicate-modal-frame {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@keyframes duplicateGlow {
  0%, 100% {
    box-shadow:
      0 50px 120px -30px rgba(0,0,0,.9),
      0 0 0 1px rgba(255,255,255,.7) inset,
      0 0 120px -20px rgba(2,83,195,.8),
      0 0 220px -40px rgba(253,212,19,.7);
  }
  50% {
    box-shadow:
      0 50px 120px -30px rgba(0,0,0,.9),
      0 0 0 1px rgba(255,255,255,.7) inset,
      0 0 180px -20px rgba(2,83,195,.95),
      0 0 280px -40px rgba(253,212,19,.95);
  }
}

/* Rainbow animated top ribbon */
.duplicate-modal-frame::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  border-radius: 36px 36px 0 0;
  background: linear-gradient(
    90deg,
    var(--brand-blue), var(--brand-red), var(--brand-yellow),
    var(--brand-green), var(--brand-coral), var(--brand-blue));
  background-size: 300% 100%;
  animation: gradientFlow 3s linear infinite;
}

/* ── Status theming ───────────────────────────────── */
.duplicate-modal.status-pending  .duplicate-modal-frame { border-color: rgba(2,83,195,.7); }
.duplicate-modal.status-approved .duplicate-modal-frame { border-color: rgba(131,228,115,.85); }
.duplicate-modal.status-rejected .duplicate-modal-frame { border-color: rgba(253,1,0,.7); }

.duplicate-modal.status-pending  .duplicate-badge {
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  box-shadow: 0 20px 50px -12px rgba(2,83,195,.8), 0 0 0 10px rgba(255,255,255,.9), 0 0 0 18px rgba(2,83,195,.2);
}
.duplicate-modal.status-approved .duplicate-badge {
  background: linear-gradient(135deg, var(--brand-green), #4fbf3a);
  box-shadow: 0 20px 50px -12px rgba(131,228,115,.8), 0 0 0 10px rgba(255,255,255,.9), 0 0 0 18px rgba(131,228,115,.25);
}
.duplicate-modal.status-rejected .duplicate-badge {
  background: linear-gradient(135deg, var(--brand-red), var(--brand-coral));
  box-shadow: 0 20px 50px -12px rgba(253,1,0,.8), 0 0 0 10px rgba(255,255,255,.9), 0 0 0 18px rgba(253,1,0,.22);
}

.duplicate-modal.status-pending  .duplicate-status-ribbon { background: linear-gradient(135deg, #eaf3ff, #d5e8ff); border-color: rgba(2,83,195,.35); color: #0253C3; }
.duplicate-modal.status-approved .duplicate-status-ribbon { background: linear-gradient(135deg, #eafbf1, #d3f6e2); border-color: rgba(131,228,115,.55); color: #167a5b; }
.duplicate-modal.status-rejected .duplicate-status-ribbon { background: linear-gradient(135deg, #fff0f0, #ffe0e0); border-color: rgba(253,1,0,.35); color: #b30000; }

.duplicate-modal.status-pending  .duplicate-status-dot { background: #0253C3; box-shadow: 0 0 0 4px rgba(2,83,195,.2); }
.duplicate-modal.status-approved .duplicate-status-dot { background: #4fbf3a; box-shadow: 0 0 0 4px rgba(131,228,115,.3); }
.duplicate-modal.status-rejected .duplicate-status-dot { background: var(--brand-red); box-shadow: 0 0 0 4px rgba(253,1,0,.2); }

/* ========== HERO BADGE ========== */
.duplicate-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.4rem;
}
.duplicate-badge {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.6rem;
  margin-bottom: 1.2rem;
  animation: duplicateBadgePop .9s cubic-bezier(.175,.885,.32,1.275) forwards;
  transition: all .5s ease;
}
@keyframes duplicateBadgePop {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.duplicate-badge > i { animation: duplicateIconPulse 2.4s ease-in-out infinite; }
@keyframes duplicateIconPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* Pulsing shockwave rings */
.duplicate-shockwave {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px solid currentColor;
  opacity: 0.5;
  animation: duplicateShockwave 2.8s ease-out infinite;
  pointer-events: none;
}
.duplicate-shockwave:nth-child(2) { animation-delay: .9s; }
.duplicate-shockwave:nth-child(3) { animation-delay: 1.8s; }

@keyframes duplicateShockwave {
  0%   { transform: scale(0.85); opacity: 0.65; }
  100% { transform: scale(1.7); opacity: 0; }
}

.duplicate-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(1.3rem, 3.8vw, 1.85rem);
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin: 0 0 8px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green) 50%, var(--brand-blue));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 4s linear infinite;
}
.duplicate-subtitle {
  font-size: .92rem;
  font-weight: 700;
  color: #5d6980;
  line-height: 1.55;
  max-width: 440px;
  margin: 0 auto;
}

/* ========== STATUS RIBBON ========== */
.duplicate-status-ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .7rem 1.1rem;
  border-radius: 16px;
  border: 2px solid;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .3px;
  margin: 1.2rem 0;
  transition: all .4s ease;
  flex-wrap: wrap;
}
.duplicate-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  animation: duplicateDotPulse 1.6s ease-in-out infinite;
}
@keyframes duplicateDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: .7; }
}
.duplicate-status-text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.duplicate-status-date {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .3px;
  opacity: .8;
  white-space: nowrap;
}

/* ========== CHILD CARD ========== */
.duplicate-child-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 1.2rem;
  margin: 0 0 1.2rem;
  background: linear-gradient(135deg, #ffffff, #f6faff);
  border-radius: 22px;
  border: 2px solid rgba(2, 83, 195, 0.12);
  box-shadow:
    0 10px 30px -12px rgba(2,83,195,.28),
    0 0 0 1px rgba(255,255,255,.9) inset;
  position: relative;
  overflow: hidden;
  animation: slideUpFade .7s .35s ease both;
}
.duplicate-child-card::before {
  content: '';
  position: absolute;
  top: -60%; left: -60%;
  width: 60%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  transform: rotate(25deg);
  animation: shineSweep 4.5s ease-in-out infinite;
  pointer-events: none;
}

.duplicate-child-photo {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  box-shadow:
    0 12px 26px -8px rgba(2,83,195,.6),
    0 0 0 6px rgba(255,255,255,.85),
    0 0 0 10px rgba(253,212,19,.25);
  animation: photoFloat 4s ease-in-out infinite;
}
.duplicate-child-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
}
.duplicate-photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf6ff, #d0ebff);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--brand-blue);
  letter-spacing: 1px;
}
.duplicate-photo-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 2px dashed rgba(253, 212, 19, 0.55);
  animation: ringSpin 12s linear infinite;
  pointer-events: none;
}

.duplicate-child-info {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}
.duplicate-child-label {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #7b8798;
  margin-bottom: 2px;
  display: block;
}
.duplicate-child-name {
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  font-weight: 900;
  color: #063676;
  line-height: 1.2;
  margin: 0 0 10px;
  word-break: break-word;
}
.duplicate-child-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
}
.duplicate-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.duplicate-detail-label {
  font-size: .62rem;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #7b8798;
  margin-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.duplicate-detail-label i { font-size: .65rem; color: var(--brand-blue); }
.duplicate-detail-value {
  font-size: .82rem;
  font-weight: 800;
  color: #063676;
  word-break: break-word;
}

/* ========== REFERENCE TICKET ========== */
.duplicate-ticket {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 1.2rem;
  padding: .95rem 1.2rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #063676 0%, #0253C3 55%, #167a5b 100%);
  color: #fff;
  box-shadow:
    0 16px 40px -14px rgba(2,83,195,.65),
    0 0 0 1px rgba(255,255,255,.15) inset;
  overflow: hidden;
  animation: slideUpFade .7s .5s ease both;
}
.duplicate-ticket::before {
  content: '';
  position: absolute;
  top: -40%; right: -30%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(253,212,19,.35), transparent 60%);
  pointer-events: none;
}
.duplicate-ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 14px; right: 14px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px);
  transform: translateY(-50%);
  opacity: .35;
  pointer-events: none;
}
.duplicate-ticket-left {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.duplicate-ticket-label {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--brand-yellow);
}
.duplicate-ticket-value {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.3rem, 3.6vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.duplicate-ticket-right {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.duplicate-ticket-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-yellow), #ffb800);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #063676;
  font-size: 1.4rem;
  box-shadow:
    0 10px 24px -6px rgba(253,212,19,.7),
    0 0 0 4px rgba(255,255,255,.25);
  animation: ticketSpin 6s ease-in-out infinite;
}

/* ========== REJECTION REASON BOX ========== */
.duplicate-reason-box {
  position: relative;
  padding: 1rem 1.15rem 1rem 3rem;
  margin: 0 0 1.2rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff0f0, #ffe0e0);
  border-left: 5px solid var(--brand-red);
  animation: slideUpFade .7s .6s ease both;
}
.duplicate-reason-box::before {
  content: '\f071';
  font-family: 'Font Awesome 6 Free', 'FontAwesome';
  font-weight: 900;
  position: absolute;
  left: 14px;
  top: 16px;
  font-size: 1.2rem;
  color: var(--brand-red);
}
.duplicate-reason-label {
  display: block;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #b30000;
  margin-bottom: 6px;
}
.duplicate-reason-text {
  font-size: .88rem;
  font-weight: 700;
  color: #5a1a1a;
  line-height: 1.55;
  margin: 0 0 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.duplicate-reason-cta {
  font-size: .78rem;
  font-weight: 700;
  font-style: italic;
  color: #7a4040;
  margin: 0;
}

/* ========== CONTACT BLOCK ========== */
.duplicate-contact {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 1rem 1.15rem;
  margin: 0 0 1.4rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff9d9, #fff4c2);
  border: 2px dashed rgba(253, 212, 19, 0.7);
  animation: slideUpFade .7s .7s ease both;
}
.duplicate-contact-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 8px 18px -6px rgba(2,83,195,.6);
}
.duplicate-contact-body { flex: 1 1 auto; min-width: 0; }
.duplicate-contact-line {
  font-size: .84rem;
  font-weight: 700;
  color: #5a3e00;
  line-height: 1.55;
  margin: 0 0 8px;
}
.duplicate-contact-email {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .5rem .9rem;
  border-radius: 40px;
  background: linear-gradient(135deg, var(--brand-blue), #0247a8);
  color: #fff !important;
  font-weight: 900;
  font-size: .82rem;
  text-decoration: none;
  letter-spacing: .3px;
  box-shadow: 0 6px 0 #013a8a, 0 10px 22px -8px rgba(2,83,195,.6);
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
  word-break: break-all;
}
.duplicate-contact-email:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #013a8a, 0 16px 30px -10px rgba(2,83,195,.85);
  color: #fff !important;
}
.duplicate-contact-email:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #013a8a;
}
.duplicate-contact-note {
  font-size: .72rem;
  font-weight: 700;
  font-style: italic;
  color: #7a5e10;
  margin: 8px 0 0;
}

/* ========== ACTION BUTTONS ========== */
.duplicate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  animation: slideUpFade .7s .8s ease both;
}
.duplicate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: .95rem 1.1rem;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: .92rem;
  letter-spacing: .4px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
  white-space: nowrap;
  text-decoration: none;
  text-align: center;
}
.duplicate-btn.primary {
  background: linear-gradient(135deg, var(--brand-red), #ff4d4d);
  color: #fff;
  box-shadow: 0 8px 0 #b30000, 0 14px 30px -10px rgba(253,1,0,.7);
}
.duplicate-btn.primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 #b30000, 0 20px 40px -12px rgba(253,1,0,.9);
  color: #fff;
}
.duplicate-btn.primary:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #b30000;
}
.duplicate-btn.secondary {
  background: #fff;
  color: #063676;
  border: 2px solid #eaf6ff;
  box-shadow: 0 6px 18px -8px rgba(2,83,195,.28);
}
.duplicate-btn.secondary:hover {
  transform: translateY(-4px);
  background: #f4faff;
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  box-shadow: 0 12px 24px -8px rgba(2,83,195,.4);
}
.duplicate-btn.secondary:active {
  transform: translateY(2px);
}

/* ========== PARTICLES LAYER ========== */
.duplicate-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 36px;
  z-index: 1;
}
.duplicate-particles span {
  position: absolute;
  top: -20px;
  width: 8px;
  height: 12px;
  opacity: 0;
  border-radius: 3px;
  animation: confettiFall linear forwards;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .duplicate-modal { padding: .5rem; align-items: flex-end; }
  .duplicate-modal-frame {
    padding: 1.8rem 1.2rem 1.4rem;
    border-radius: 28px 28px 0 0;
    max-width: 100%;
    max-height: 96vh;
  }
  .duplicate-modal-frame::before { border-radius: 28px 28px 0 0; }
  .duplicate-badge { width: 88px; height: 88px; font-size: 2rem; }
  .duplicate-child-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem .9rem;
  }
  .duplicate-child-info { text-align: center; }
  .duplicate-child-details { grid-template-columns: 1fr; text-align: left; }
  .duplicate-child-photo { width: 86px; height: 86px; }
  .duplicate-ticket { padding: .8rem 1rem; }
  .duplicate-ticket-icon { width: 44px; height: 44px; font-size: 1.2rem; }
  .duplicate-contact { flex-direction: column; }
  .duplicate-contact-icon { align-self: flex-start; }
  .duplicate-actions { grid-template-columns: 1fr; gap: 10px; }
  .duplicate-btn { padding: .85rem 1rem; font-size: .88rem; }
}
@media (max-width: 380px) {
  .duplicate-modal-frame { padding: 1.4rem .9rem 1rem; }
  .duplicate-title { font-size: 1.15rem; }
  .duplicate-subtitle { font-size: .8rem; }
  .duplicate-child-name { font-size: 1rem; }
  .duplicate-detail-value { font-size: .78rem; }
  .duplicate-contact-email { font-size: .74rem; padding: .45rem .75rem; }
}
@media (min-width: 1280px) {
  .duplicate-modal-frame { max-width: 680px; }
}

/* ========== PRINT ========== */
@media print {
  .duplicate-modal { display: none !important; }
}

/* ============================================================
   🏆 THE MOST BEAUTIFUL SUCCESS MODAL IN THE WORLD
============================================================ */
.success-modal {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 20% 20%, rgba(2,83,195,.35), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(253,212,19,.35), transparent 55%),
    rgba(2, 10, 26, 0.72);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  opacity: 0;
  transition: opacity .5s ease;
  overflow-y: auto;
}
.success-modal.active { display: flex; opacity: 1; }

.success-modal-frame {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 96vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 36px;
  padding: 2.4rem 2rem 2rem;
  background:
    linear-gradient(155deg, #ffffff 0%, #f4faff 45%, #fff9e6 100%);
  box-shadow:
    0 50px 120px -30px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255,255,255,0.7) inset,
    0 0 120px -20px rgba(253, 212, 19, 0.7),
    0 0 200px -40px rgba(2, 83, 195, 0.6);
  border: 3px solid rgba(253, 212, 19, 0.7);
  transform: translateY(60px) scale(0.85);
  opacity: 0;
  transition: transform .65s cubic-bezier(.175,.885,.32,1.275), opacity .4s ease;
  animation: successGlow 5s ease-in-out infinite;
  scrollbar-width: thin;
  scrollbar-color: rgba(2,83,195,.4) transparent;
}
.success-modal-frame::-webkit-scrollbar { width: 8px; }
.success-modal-frame::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--brand-blue), var(--brand-green));
  border-radius: 10px;
}
.success-modal.active .success-modal-frame {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@keyframes successGlow {
  0%, 100% {
    box-shadow:
      0 50px 120px -30px rgba(0,0,0,.85),
      0 0 0 1px rgba(255,255,255,.7) inset,
      0 0 120px -20px rgba(253,212,19,.7),
      0 0 200px -40px rgba(2,83,195,.6);
  }
  50% {
    box-shadow:
      0 50px 120px -30px rgba(0,0,0,.85),
      0 0 0 1px rgba(255,255,255,.7) inset,
      0 0 180px -20px rgba(253,212,19,.95),
      0 0 260px -40px rgba(2,83,195,.85);
  }
}

/* Rainbow animated top ribbon */
.success-modal-frame::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 10px;
  border-radius: 36px 36px 0 0;
  background: linear-gradient(
    90deg,
    var(--brand-blue), var(--brand-red), var(--brand-yellow),
    var(--brand-green), var(--brand-coral), var(--brand-blue));
  background-size: 300% 100%;
  animation: gradientFlow 3s linear infinite;
}

/* ========== HERO SUCCESS BADGE ========== */
.success-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.4rem;
}
.success-badge {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-green), #4fbf3a 60%, var(--brand-blue));
  box-shadow:
    0 20px 50px -12px rgba(131, 228, 115, 0.8),
    0 0 0 10px rgba(255,255,255,.9),
    0 0 0 18px rgba(131, 228, 115, 0.2);
  margin-bottom: 1.2rem;
  animation: badgePop .8s cubic-bezier(.175,.885,.32,1.275) forwards;
}
@keyframes badgePop {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.success-badge svg {
  width: 60px;
  height: 60px;
  stroke: #fff;
  stroke-width: 5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-badge svg path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: drawCheck .8s .5s ease forwards;
}
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

/* Pulsing shockwave rings */
.success-shockwave,
.success-shockwave::before,
.success-shockwave::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 3px solid rgba(131, 228, 115, 0.6);
  animation: shockwave 2.8s ease-out infinite;
  pointer-events: none;
}
.success-shockwave::before { animation-delay: .9s; }
.success-shockwave::after  { animation-delay: 1.8s; }
@keyframes shockwave {
  0%   { transform: scale(0.85); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

.success-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: -0.5px;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green) 50%, var(--brand-blue));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 4s linear infinite;
  margin: 0 0 6px;
}
.success-subtitle {
  font-size: .92rem;
  font-weight: 700;
  color: #5d6980;
  line-height: 1.5;
  max-width: 420px;
  margin: 0 auto;
}

/* ========== CHILD CARD (avatar + details) ========== */
.success-child-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 1rem 1.1rem;
  margin: 1.4rem 0 1rem;
  background: linear-gradient(135deg, #ffffff, #f6faff);
  border-radius: 22px;
  border: 2px solid rgba(2, 83, 195, 0.12);
  box-shadow:
    0 10px 30px -12px rgba(2,83,195,.28),
    0 0 0 1px rgba(255,255,255,.9) inset;
  position: relative;
  overflow: hidden;
  animation: slideUpFade .7s .35s ease both;
}
.success-child-card::before {
  content: '';
  position: absolute;
  top: -60%; left: -60%;
  width: 60%; height: 220%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  transform: rotate(25deg);
  animation: shineSweep 4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shineSweep {
  0%, 70% { left: -60%; }
  100%    { left: 160%; }
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.success-child-photo {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-green));
  padding: 3px;
  box-shadow:
    0 12px 26px -8px rgba(2,83,195,.6),
    0 0 0 6px rgba(255,255,255,.85),
    0 0 0 10px rgba(253,212,19,.25);
  position: relative;
  animation: photoFloat 4s ease-in-out infinite;
}
@keyframes photoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.success-child-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #fff;
}
.success-child-photo .photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf6ff, #d0ebff);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--brand-blue);
  letter-spacing: 1px;
}

.success-child-info {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}
.success-child-label {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #7b8798;
  margin-bottom: 2px;
  display: block;
}
.success-child-name {
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  font-weight: 900;
  color: #063676;
  line-height: 1.2;
  margin: 0 0 4px;
  word-break: break-word;
}
.success-child-id {
  font-size: .78rem;
  font-weight: 800;
  color: #167a5b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(131,228,115,.18), rgba(131,228,115,.08));
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid rgba(131,228,115,.4);
}
.success-child-id i { font-size: .7rem; }

/* ========== REFERENCE TICKET ========== */
.success-ticket {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 1rem 0 1.2rem;
  padding: .95rem 1.2rem;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #063676 0%, #0253C3 55%, #167a5b 100%);
  color: #fff;
  box-shadow:
    0 16px 40px -14px rgba(2,83,195,.65),
    0 0 0 1px rgba(255,255,255,.15) inset;
  overflow: hidden;
  animation: slideUpFade .7s .5s ease both;
}
.success-ticket::before {
  content: '';
  position: absolute;
  top: -40%; right: -30%;
  width: 60%; height: 200%;
  background: radial-gradient(circle, rgba(253,212,19,.35), transparent 60%);
  pointer-events: none;
}
.success-ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 14px; right: 14px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px);
  transform: translateY(-50%);
  opacity: .35;
  pointer-events: none;
}
.success-ticket-left {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.success-ticket-label {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--brand-yellow);
}
.success-ticket-value {
  font-family: 'Nunito', sans-serif;
  font-size: clamp(1.3rem, 3.6vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 1px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.success-ticket-right {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.success-ticket-icon {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-yellow), #ffb800);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #063676;
  font-size: 1.4rem;
  box-shadow:
    0 10px 24px -6px rgba(253,212,19,.7),
    0 0 0 4px rgba(255,255,255,.25);
  animation: ticketSpin 6s ease-in-out infinite;
}
@keyframes ticketSpin {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50%      { transform: rotate(8deg) scale(1.08); }
}

/* ========== PROFESSIONAL MESSAGE BOX ========== */
.success-message {
  position: relative;
  padding: 1rem 1.15rem 1rem 3rem;
  margin: 0 0 1.4rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff9d9, #fff4c2);
  border-left: 5px solid var(--brand-yellow);
  font-size: .88rem;
  font-weight: 700;
  color: #5a3e00;
  line-height: 1.55;
  text-align: left;
  animation: slideUpFade .7s .65s ease both;
}
.success-message::before {
  content: '\f0eb';
  font-family: 'Font Awesome 6 Free', 'Font Awesome 6 Brands', 'FontAwesome';
  font-weight: 900;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--brand-red);
  animation: bulbGlow 2.4s ease-in-out infinite;
}
@keyframes bulbGlow {
  0%, 100% { opacity: .85; text-shadow: 0 0 0 rgba(253,1,0,0); }
  50%      { opacity: 1;   text-shadow: 0 0 14px rgba(253,1,0,.7); }
}

/* ========== ACTION BUTTONS ========== */
.success-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: .4rem;
  animation: slideUpFade .7s .8s ease both;
}
.success-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: .95rem 1.1rem;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: .92rem;
  letter-spacing: .4px;
  cursor: pointer;
  transition: all .25s cubic-bezier(.175,.885,.32,1.275);
  white-space: nowrap;
  text-decoration: none;
}
.success-btn.primary {
  background: linear-gradient(135deg, var(--brand-blue), #013a8a);
  color: #fff;
  box-shadow: 0 8px 0 #013a8a, 0 14px 30px -10px rgba(2,83,195,.7);
}
.success-btn.primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 #013a8a, 0 20px 40px -12px rgba(2,83,195,.9);
}
.success-btn.primary:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #013a8a;
}
.success-btn.secondary {
  background: #fff;
  color: #063676;
  border: 2px solid #eaf6ff;
  box-shadow: 0 6px 18px -8px rgba(2,83,195,.28);
}
.success-btn.secondary:hover {
  transform: translateY(-4px);
  background: #f4faff;
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  box-shadow: 0 12px 24px -8px rgba(2,83,195,.4);
}
.success-btn.secondary:active {
  transform: translateY(2px);
}

/* ========== CONFETTI LAYER ========== */
.success-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 36px;
  z-index: 1;
}
.success-confetti span {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 16px;
  opacity: 0;
  border-radius: 3px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 560px) {
  .success-modal { padding: .5rem; align-items: flex-end; }
  .success-modal-frame {
    padding: 1.8rem 1.2rem 1.4rem;
    border-radius: 28px 28px 0 0;
    max-width: 100%;
    max-height: 94vh;
  }
  .success-modal-frame::before { border-radius: 28px 28px 0 0; }
  .success-badge { width: 88px; height: 88px; }
  .success-badge svg { width: 46px; height: 46px; }
  .success-child-card { padding: .85rem .9rem; gap: 12px; }
  .success-child-photo { width: 62px; height: 62px; }
  .success-ticket { padding: .8rem 1rem; }
  .success-ticket-icon { width: 44px; height: 44px; font-size: 1.2rem; }
  .success-message { padding: .9rem 1rem .9rem 2.7rem; font-size: .82rem; }
  .success-message::before { font-size: 1.15rem; left: 12px; }
  .success-actions { grid-template-columns: 1fr; gap: 10px; }
  .success-btn { padding: .85rem 1rem; font-size: .88rem; }
}
@media (max-width: 360px) {
  .success-modal-frame { padding: 1.4rem .9rem 1rem; }
  .success-title { font-size: 1.25rem; }
  .success-subtitle { font-size: .82rem; }
}

/* ========== PRINT (hide modal) ========== */
@media print {
  .success-modal { display: none !important; }
}

/* ============================================================
   🏆 THE WORLD'S MOST BEAUTIFUL FIELD HIGHLIGHTING SYSTEM
   ------------------------------------------------------------
   When a user submits with missing fields, we:
   • Dim the entire page (backdrop)
   • Create a glowing "spotlight" ring around the target field
   • Point at it with an animated bouncing arrow
   • Show a friendly tooltip card with a message
   • Smoothly scroll it into view (centered)
   • Auto-remove after ~4 seconds or when user types
============================================================ */

/* ---- Page-wide dimmer overlay ---- */
.ek-field-dimmer {
  position: fixed;
  inset: 0;
  background: rgba(2, 10, 26, 0.55);
  backdrop-filter: blur(3px) saturate(120%);
  -webkit-backdrop-filter: blur(3px) saturate(120%);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s cubic-bezier(.22,1,.36,1);
}
.ek-field-dimmer.active {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Spotlight ring (the glowing highlight) ---- */
.ek-field-spotlight {
  position: absolute;
  border-radius: 14px;
  pointer-events: none;
  z-index: 100001;
  box-shadow:
    0 0 0 3px #FDD413,
    0 0 0 6px rgba(253, 212, 19, 0.35),
    0 0 32px 8px rgba(253, 212, 19, 0.55),
    0 0 80px 20px rgba(253, 212, 19, 0.28),
    0 20px 50px -10px rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.02);
  transition:
    top .45s cubic-bezier(.22,1,.36,1),
    left .45s cubic-bezier(.22,1,.36,1),
    width .45s cubic-bezier(.22,1,.36,1),
    height .45s cubic-bezier(.22,1,.36,1),
    opacity .35s ease;
  animation: ekSpotlightPulse 1.6s ease-in-out infinite;
}
@keyframes ekSpotlightPulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px #FDD413,
      0 0 0 6px rgba(253, 212, 19, 0.35),
      0 0 32px 8px rgba(253, 212, 19, 0.55),
      0 0 80px 20px rgba(253, 212, 19, 0.28),
      0 20px 50px -10px rgba(0, 0, 0, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 4px #FDD413,
      0 0 0 10px rgba(253, 212, 19, 0.5),
      0 0 48px 12px rgba(253, 212, 19, 0.75),
      0 0 110px 30px rgba(253, 212, 19, 0.4),
      0 20px 50px -10px rgba(0, 0, 0, 0.5);
  }
}

/* ---- Shimmer sweep inside spotlight ---- */
.ek-field-spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: ekShimmerSweep 2.2s linear infinite;
  pointer-events: none;
}
@keyframes ekShimmerSweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* ---- Corner brackets for a "camera focus" feel ---- */
.ek-field-spotlight::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 18px;
  pointer-events: none;
  background:
    /* top-left */
    linear-gradient(to right, #FDD413 0 22px, transparent 22px) 0 0 / 100% 3px no-repeat,
    linear-gradient(to bottom, #FDD413 0 22px, transparent 22px) 0 0 / 3px 100% no-repeat,
    /* top-right */
    linear-gradient(to left, #FDD413 0 22px, transparent 22px) 100% 0 / 100% 3px no-repeat,
    linear-gradient(to bottom, #FDD413 0 22px, transparent 22px) 100% 0 / 3px 100% no-repeat,
    /* bottom-left */
    linear-gradient(to right, #FDD413 0 22px, transparent 22px) 0 100% / 100% 3px no-repeat,
    linear-gradient(to top, #FDD413 0 22px, transparent 22px) 0 100% / 3px 100% no-repeat,
    /* bottom-right */
    linear-gradient(to left, #FDD413 0 22px, transparent 22px) 100% 100% / 100% 3px no-repeat,
    linear-gradient(to top, #FDD413 0 22px, transparent 22px) 100% 100% / 3px 100% no-repeat;
  animation: ekBracketPulse 1.6s ease-in-out infinite;
}
@keyframes ekBracketPulse {
  0%, 100% { opacity: 0.9; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.02); }
}

/* ---- Friendly tooltip card ---- */
.ek-field-tooltip {
  position: absolute;
  z-index: 100002;
  pointer-events: none;
  max-width: 340px;
  min-width: 220px;
  padding: 14px 18px 14px 52px;
  background: linear-gradient(155deg, #ffffff 0%, #f4faff 55%, #fff9e6 100%);
  border-radius: 18px;
  border: 2px solid rgba(253, 212, 19, 0.8);
  box-shadow:
    0 24px 60px -12px rgba(2, 83, 195, 0.5),
    0 0 0 1px rgba(255,255,255,0.8) inset,
    0 0 40px -10px rgba(253, 212, 19, 0.6);
  font-family: 'Nunito', sans-serif;
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  transition:
    opacity .35s cubic-bezier(.22,1,.36,1),
    transform .45s cubic-bezier(.22,1,.36,1),
    top .45s cubic-bezier(.22,1,.36,1),
    left .45s cubic-bezier(.22,1,.36,1);
}
.ek-field-tooltip.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.ek-field-tooltip::before {
  content: '\f0eb';
  font-family: 'Font Awesome 6 Free', 'FontAwesome';
  font-weight: 900;
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FDD413, #ffb800);
  color: #063676;
  font-size: 0.9rem;
  box-shadow: 0 6px 14px -4px rgba(253, 212, 19, 0.7);
  animation: ekBulbPulse 1.6s ease-in-out infinite;
}
@keyframes ekBulbPulse {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50%      { transform: translateY(-50%) scale(1.12); }
}
.ek-field-tooltip-title {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #FD0100;
  margin-bottom: 4px;
  display: block;
}
.ek-field-tooltip-message {
  font-size: 0.9rem;
  font-weight: 800;
  color: #063676;
  line-height: 1.35;
  margin: 0;
}
.ek-field-tooltip-hint {
  font-size: 0.72rem;
  font-weight: 700;
  color: #5d6980;
  margin: 5px 0 0;
  font-style: italic;
}
.ek-field-tooltip-arrow {
  position: absolute;
  width: 16px;
  height: 16px;
  background: linear-gradient(155deg, #ffffff 0%, #fff9e6 100%);
  border-right: 2px solid rgba(253, 212, 19, 0.8);
  border-bottom: 2px solid rgba(253, 212, 19, 0.8);
  transform: rotate(45deg);
}
/* Arrow points UP (tooltip is below field) */
.ek-field-tooltip.arrow-top .ek-field-tooltip-arrow {
  top: -9px;
  left: 50%;
  margin-left: -8px;
}
/* Arrow points DOWN (tooltip is above field) */
.ek-field-tooltip.arrow-bottom .ek-field-tooltip-arrow {
  bottom: -9px;
  left: 50%;
  margin-left: -8px;
  transform: rotate(225deg);
}

/* ---- Animated bouncing arrow (points at field) ---- */
.ek-field-pointer {
  position: absolute;
  z-index: 100002;
  pointer-events: none;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #FDD413, #ffb800);
  color: #063676;
  border-radius: 50%;
  font-size: 1.4rem;
  border: 3px solid #ffffff;
  box-shadow:
    0 14px 30px -8px rgba(253, 212, 19, 0.8),
    0 0 0 4px rgba(253, 212, 19, 0.25);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity .35s ease,
    transform .5s cubic-bezier(.22,1,.36,1),
    top .45s cubic-bezier(.22,1,.36,1),
    left .45s cubic-bezier(.22,1,.36,1);
  animation: ekPointerBounce 1.2s ease-in-out infinite;
}
.ek-field-pointer.active {
  opacity: 1;
  transform: scale(1);
}
@keyframes ekPointerBounce {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}
.ek-field-pointer.point-down { animation: ekPointerBounceDown 1.2s ease-in-out infinite; }
.ek-field-pointer.point-up   { animation: ekPointerBounceUp 1.2s ease-in-out infinite; }
@keyframes ekPointerBounceDown {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 8px; }
}
@keyframes ekPointerBounceUp {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -8px; }
}

/* ---- Inline field flash (for inputs already in view) ---- */
.ek-field-flash {
  animation: ekFieldFlash 2.4s cubic-bezier(.22,1,.36,1);
}
@keyframes ekFieldFlash {
  0%   { background-color: rgba(253, 212, 19, 0); }
  15%  { background-color: rgba(253, 212, 19, 0.45); }
  40%  { background-color: rgba(253, 212, 19, 0.15); }
  100% { background-color: rgba(253, 212, 19, 0); }
}

/* ---- Progress pill at the top (tells user "3 of 5") ---- */
.ek-validation-progress {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-140%);
  z-index: 100003;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #063676, #0253C3);
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .4px;
  border-radius: 40px;
  box-shadow:
    0 18px 40px -12px rgba(2, 83, 195, 0.6),
    0 0 0 3px rgba(253, 212, 19, 0.35);
  transition: transform .5s cubic-bezier(.22,1,.36,1), opacity .4s ease;
  opacity: 0;
  pointer-events: none;
}
.ek-validation-progress.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.ek-validation-progress .ek-vp-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #FDD413;
  box-shadow: 0 0 0 4px rgba(253, 212, 19, 0.25);
  animation: ekVpDotPulse 1.4s ease-in-out infinite;
}
@keyframes ekVpDotPulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.3); opacity: .7; }
}
.ek-validation-progress .ek-vp-text span {
  color: #FDD413;
}

/* ---- Responsive tuning ---- */
@media (max-width: 768px) {
  .ek-field-tooltip {
    max-width: 88vw;
    min-width: 0;
    padding: 12px 16px 12px 46px;
  }
  .ek-field-tooltip::before { width: 26px; height: 26px; font-size: .8rem; left: 12px; }
  .ek-field-tooltip-title   { font-size: .62rem; }
  .ek-field-tooltip-message { font-size: .84rem; }
  .ek-field-tooltip-hint    { font-size: .68rem; }
  .ek-field-pointer         { width: 46px; height: 46px; font-size: 1.1rem; }
  .ek-validation-progress   { top: 68px; font-size: .78rem; padding: 8px 16px; }
}
@media (max-width: 480px) {
  .ek-field-tooltip {
    max-width: 92vw;
    padding: 11px 14px 11px 42px;
  }
  .ek-field-tooltip-message { font-size: .8rem; }
  .ek-field-pointer { width: 40px; height: 40px; font-size: 1rem; }
}

/* ---- Extra beauty: glowing pulse for signature pads & upload cards when highlighted ---- */
.signature-pad-wrapper.ek-target-glow,
.upload-card.ek-target-glow {
  border-color: #FDD413 !important;
  box-shadow:
    0 0 0 3px #FDD413,
    0 0 0 8px rgba(253, 212, 19, 0.35),
    0 0 40px 12px rgba(253, 212, 19, 0.55),
    0 24px 50px -12px rgba(2, 83, 195, 0.5) !important;
  animation: ekTargetGlow 1.6s ease-in-out infinite;
}
@keyframes ekTargetGlow {
  0%, 100% {
    box-shadow:
      0 0 0 3px #FDD413,
      0 0 0 8px rgba(253, 212, 19, 0.35),
      0 0 40px 12px rgba(253, 212, 19, 0.55),
      0 24px 50px -12px rgba(2, 83, 195, 0.5);
  }
  50% {
    box-shadow:
      0 0 0 4px #FDD413,
      0 0 0 14px rgba(253, 212, 19, 0.5),
      0 0 60px 18px rgba(253, 212, 19, 0.75),
      0 24px 50px -12px rgba(2, 83, 195, 0.5);
  }
}

/* Signature wrapper shake/pulse to pull attention */
.signature-pad-wrapper.ek-target-glow .signature-placeholder {
  color: #FD0100 !important;
  font-weight: 900 !important;
  animation: ekPlaceholderPulse 1.2s ease-in-out infinite;
}
@keyframes ekPlaceholderPulse {
  0%, 100% { opacity: 0.9; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.06); }
}

/* Upload card glow — makes the "hand-pointer" instruction pulse too */
.upload-card.ek-target-glow .upload-card-click-instruction {
  background: rgba(253, 212, 19, 0.25) !important;
  border-color: #FDD413 !important;
  color: #b47900 !important;
  animation: instructionPulse 1s ease-in-out infinite;
}
.upload-card.ek-target-glow .upload-card-icon {
  transform: scale(1.15) rotate(-8deg);
  background: linear-gradient(135deg, #FDD413, #ffb800) !important;
  color: #063676 !important;
  box-shadow:
    0 12px 30px -8px rgba(253, 212, 19, 0.9),
    0 0 0 6px rgba(253, 212, 19, 0.25);
  animation: ekIconWiggle 1.2s ease-in-out infinite;
}
@keyframes ekIconWiggle {
  0%, 100% { transform: scale(1.15) rotate(-8deg); }
  50%      { transform: scale(1.22) rotate(8deg); }
}

/* ---- Reduced motion (accessibility) ---- */
@media (prefers-reduced-motion: reduce) {
  .ek-field-spotlight,
  .ek-field-spotlight::before,
  .ek-field-spotlight::after,
  .ek-field-pointer,
  .ek-field-tooltip::before,
  .ek-validation-progress .ek-vp-dot,
  .signature-pad-wrapper.ek-target-glow,
  .upload-card.ek-target-glow,
  .signature-pad-wrapper.ek-target-glow .signature-placeholder,
  .upload-card.ek-target-glow .upload-card-icon,
  .upload-card.ek-target-glow .upload-card-click-instruction {
    animation: none !important;
  }
  .ek-field-spotlight,
  .ek-field-pointer,
  .ek-field-tooltip {
    transition-duration: .01ms !important;
  }
}

