:root {
  --teal: #1e9daf;
  --teal-dark: #127a88;
  --teal-light: #5cc8d6;
  --sky: #3fa9f5;
  --ink: #14232c;
  --muted: #5b6d77;
  --bg: #eaf5f8;
  --line: #d3e6eb;
  --field: #f5fafb;
  --error: #d32f2f;
  --green: #1faa59;
  --green-dark: #128c47;
  --amber: #f0a500;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Poppins", system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(30, 157, 175, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 157, 175, 0.06) 1px, transparent 1px);
  background-size: 36px 36px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Blurred background shapes, like the poster */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; }
.blob-1 { width: 320px; height: 320px; background: #7fe0d0; top: -80px; left: -120px; animation: drift 14s ease-in-out infinite alternate; }
.blob-2 { width: 280px; height: 280px; background: #9fd4f5; bottom: 10%; right: -120px; animation: drift 18s ease-in-out infinite alternate-reverse; }
.blob-3 { width: 220px; height: 220px; background: #c9eef2; top: 45%; left: -80px; animation: drift 16s ease-in-out infinite alternate; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.12); }
}

.page {
  max-width: 460px;
  margin: 0 auto;
  padding: 36px 16px 32px;
}

/* ---------- Hero ---------- */
.hero { text-align: center; position: relative; }

.tagline { margin: 0; font-size: 1.1rem; letter-spacing: 0.2px; color: var(--ink); }
.tagline b { font-weight: 700; }

h1 { margin: 8px 0 0; line-height: 0.88; }
.mbbs {
  display: block;
  font-weight: 800;
  font-size: clamp(3.6rem, 21vw, 5.6rem);
  letter-spacing: -2px;
  background: linear-gradient(180deg, #25b3c5 0%, var(--teal) 55%, var(--teal-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 rgba(18, 122, 136, 0.12));
}
.orientation {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-weight: 400;
  font-size: clamp(3.4rem, 19.5vw, 5.3rem);
  letter-spacing: 1px;
  color: var(--teal);
}

.year-row { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; }
.dots {
  flex: 1;
  height: 16px;
  background: radial-gradient(circle, transparent 3px, var(--teal-light) 3.5px, var(--teal-light) 5px, transparent 5.5px) 0 50% / 20px 16px repeat-x;
  opacity: 0.7;
}
.year { font-size: 1.7rem; font-weight: 500; color: #7c8b93; letter-spacing: 2px; }

.ecg { display: block; width: 100%; height: 44px; margin: 4px 0 10px; }
.ecg path {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 520;
  stroke-dashoffset: 520;
  animation: beat 3.2s ease-in-out infinite;
  opacity: 0.55;
}
@keyframes beat {
  0% { stroke-dashoffset: 520; }
  55% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -520; }
}

.meta { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 13px;
  font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  border-radius: 8px;
}
.chip svg { width: 20px; height: 20px; flex: none; }
.chip-solid { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(30, 157, 175, 0.35); }
.chip-solid svg { fill: #fff; }
.chip-outline { background: #fff; border: 1.5px solid var(--ink); }

/* ---------- Card ---------- */
.card {
  margin-top: 28px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  padding: 26px 20px 22px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 50px -12px rgba(18, 122, 136, 0.28);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--sky), var(--teal-light));
}

.card-head { margin-bottom: 20px; }
.card h2 { margin: 0 0 4px; font-size: 1.45rem; font-weight: 700; }
.hint { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }

.field { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.field label, .field legend {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #3c4f59;
  margin-bottom: 8px;
  padding: 0;
}

.input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-wrap svg { width: 20px; height: 20px; fill: #8fb3bb; flex: none; transition: fill 0.2s; }
.input-wrap .prefix {
  font-weight: 600; color: var(--muted);
  padding-right: 10px; border-right: 1.5px solid var(--line);
}
.input-wrap:focus-within {
  background: #fff;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(30, 157, 175, 0.15);
}
.input-wrap:focus-within svg { fill: var(--teal); }
.input-wrap.invalid { border-color: var(--error); box-shadow: 0 0 0 4px rgba(211, 47, 47, 0.1); }

.input-wrap input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1rem;
  padding: 14px 0;
  border: 0; outline: none;
  background: transparent;
  color: var(--ink);
}
.input-wrap input::placeholder { color: #9aabb2; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.segmented label { margin: 0; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 1rem; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: block;
  text-align: center;
  padding: 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  color: #3c4f59;
  background: var(--field);
  transition: all 0.2s ease;
}
.segmented label:hover span { border-color: var(--teal-light); }
.segmented input:checked + span {
  background: linear-gradient(135deg, #22b0c2, var(--teal-dark));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px -6px rgba(30, 157, 175, 0.6);
  transform: translateY(-1px);
}
.segmented input:focus-visible + span { outline: 3px solid rgba(30, 157, 175, 0.35); outline-offset: 2px; }

.collapsible:not([hidden]) { animation: slideIn 0.3s ease; }
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.error { margin: 7px 0 0 2px; color: var(--error); font-size: 0.82rem; font-weight: 500; }
.error:empty { display: none; }
.form-error {
  margin: 0 0 14px; padding: 10px 12px;
  text-align: center;
  background: #fdecec; border-radius: 10px;
}

.btn-primary {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  margin-top: 6px;
  font: inherit; font-weight: 700; font-size: 1.05rem;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, #25b3c5 0%, var(--teal) 50%, var(--teal-dark) 100%);
  border: 0; border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 12px 24px -8px rgba(30, 157, 175, 0.65);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary::after {
  content: "";
  position: absolute; top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  animation: shine 3.5s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 28px -8px rgba(30, 157, 175, 0.7); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { cursor: wait; opacity: 0.85; transform: none; }

.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.btn-primary.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Result ---------- */
.result { text-align: center; padding: 8px 0 4px; animation: slideIn 0.35s ease; }
.result h2 { margin: 0 0 6px; font-size: 1.4rem; }
.result p { color: var(--muted); margin: 0 0 18px; line-height: 1.5; }

.result-icon { width: 76px; height: 76px; margin: 0 auto 14px; }
.result-icon svg { width: 100%; height: 100%; fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.result-icon circle { stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw 0.6s ease forwards; }
.result-icon path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 0.4s 0.5s ease forwards; }
.icon-check { stroke: var(--green); }
.icon-info { stroke: var(--amber); display: none; }
.result.duplicate .icon-check { display: none; }
.result.duplicate .icon-info { display: block; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.progress { height: 6px; border-radius: 99px; background: #e2eff2; overflow: hidden; margin: 0 0 18px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #4cd787); border-radius: inherit; }
.progress.run span { animation: fill var(--redirect-ms, 1500ms) linear forwards; }
.result.duplicate .progress { display: none; }
@keyframes fill { to { width: 100%; } }

.btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #25d366, var(--green-dark));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 24px -8px rgba(31, 170, 89, 0.6);
  transition: transform 0.15s;
}
.btn-whatsapp:hover { transform: translateY(-1px); }

/* ---------- Footer ---------- */
.footer { text-align: center; margin-top: 30px; color: var(--muted); }
.footer p { margin: 0; }
.motto { font-size: 0.78rem; }
.motto b { color: var(--ink); }
.brand {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.3rem; letter-spacing: 4px; line-height: 1.1;
  color: var(--ink);
}
.sub { font-size: 0.64rem; letter-spacing: 3.5px; text-transform: uppercase; font-weight: 600; }
.venue {
  display: inline-block;
  margin-top: 12px !important;
  padding: 6px 12px;
  font-size: 0.8rem;
  border: 1px solid #b9cbd1;
  border-radius: 6px;
  transform: rotate(-1.5deg);
  background: rgba(255, 255, 255, 0.6);
}
.venue b { color: var(--ink); }

/* ---------- Entrance ---------- */
.reveal { opacity: 0; transform: translateY(14px); animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.hero .reveal:nth-child(1) { animation-delay: 0.05s; }
.hero .reveal:nth-child(2) { animation-delay: 0.15s; }
.hero .reveal:nth-child(3) { animation-delay: 0.25s; }
.hero .reveal:nth-child(5) { animation-delay: 0.35s; }
.card.reveal { animation-delay: 0.45s; }
.footer.reveal { animation-delay: 0.6s; }
@keyframes rise { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .ecg path { animation: none !important; stroke-dashoffset: 0; }
}
