/* =====================================================================
   Application form — Dr. Roitman Online Endodontic Residency
   Single-card on gradient bg, glow title, pill inputs, heartbeat submit
   ===================================================================== */

@font-face {
  font-family: "Seravek";
  src: url("fonts/Seravek.ttc") format("truetype-collection"),
       url("fonts/Seravek.ttc");
  font-weight: 300 700;
  font-display: swap;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Seravek", "Nunito Sans", system-ui, -apple-system, sans-serif;
  color: var(--sr-navy);
  background: var(--sr-bg-alt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Page background — brand gradient with soft motion ---------- */
.page {
  min-height: 100vh;
  padding: 56px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 80% 0%, rgba(253,166,50,0.18), transparent 60%),
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(255,255,255,0.20), transparent 55%),
    linear-gradient(135deg, #0c7e91 0%, #0ab291 100%);
}

/* faint floating tooth row in background, very subtle */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("assets/tooth_row_raster.png");
  background-repeat: no-repeat;
  background-position: center 92%;
  background-size: 1200px auto;
  opacity: 0.06;
  pointer-events: none;
}

/* ---------- Card ---------- */
.card {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: linear-gradient(160deg, #0c2952 0%, #0a3d5c 100%);
  border-radius: 28px;
  padding: 48px 48px 44px;
  box-shadow:
    0 30px 80px rgba(7,40,55,0.45),
    0 8px 20px rgba(7,40,55,0.30),
    0 0 0 2px rgba(255,255,255,0.10) inset;
  z-index: 1;
}

/* ---------- Logo lockup at top of card ---------- */
.logo-lockup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.logo-lockup .badge {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0c7e91 0%, #0ab291 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(10,178,145,0.35);
}

.logo-lockup .badge img {
  width: 56px;
  height: auto;
  filter: brightness(0) invert(1);
}

.logo-lockup .name {
  font-family: "Source Sans 3", "Myriad Pro", system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #ffffff;
  letter-spacing: 0.01em;
  margin: 0;
}

.logo-lockup .tagline {
  font-family: "Source Sans 3", "Myriad Pro", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6dd5c0;
  font-weight: 700;
  margin: 0;
}

/* ---------- Title with glow ---------- */
.title {
  font-family: "Source Sans 3", "Myriad Pro", system-ui, sans-serif;
  font-weight: 800;
  font-size: 42px;
  line-height: 1.1;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 14px;
  color: #ffffff;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.title .accent {
  color: #6dd5c0;
  background: linear-gradient(90deg, #6dd5c0 0%, #fda632 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 0 14px rgba(10,178,145,0.35));
  animation: glow 3.6s ease-in-out infinite;
}

@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(10,178,145,0.30)); }
  50%      { filter: drop-shadow(0 0 22px rgba(10,178,145,0.55)); }
}

.subtitle {
  text-align: center;
  font-size: 17px;
  line-height: 1.5;
  color: #c8e0e6;
  font-weight: 600;
  margin: 0 0 10px;
  text-wrap: pretty;
}

.subtitle b {
  color: #ffffff;
  font-weight: 800;
}

.outcome {
  text-align: center;
  font-size: 14px;
  color: #fda632;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 36px;
}

/* ---------- Form ---------- */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field { position: relative; }

.field label {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 8px 4px;
  letter-spacing: 0;
  text-transform: none;
}

.field label .req {
  color: #fda632;
  margin-left: 4px;
  font-weight: 800;
}

.field .helper {
  margin: 8px 4px 0;
  font-size: 13px;
  line-height: 1.45;
  font-style: italic;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 2px solid transparent;
  background: #ffffff;
  border-radius: 999px;
  padding: 17px 22px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #0c2952;
  transition: all 180ms ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: 0 4px 0 rgba(0,0,0,0.25), 0 8px 18px rgba(0,0,0,0.18);
}

.field textarea {
  border-radius: 22px;
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

/* Auto-grow textarea — visually identical to a single-line input until the
   user types more than fits, then it expands vertically. Wraps text. */
.field textarea.auto {
  border-radius: 999px;
  resize: none;
  min-height: 0;
  overflow: hidden;
  line-height: 1.4;
  padding: 17px 22px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* When auto textarea grows past one line, give it slightly softer corners */
.field textarea.auto:not([style*="height: 0"]) { transition: border-radius 120ms ease; }
.field textarea.auto[style] { border-radius: 22px; }

.field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%230c2952' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 22px center;
  padding-right: 48px;
  cursor: pointer;
}

.field input::placeholder,
.field textarea::placeholder,
.field select:invalid {
  color: #2a4254;
  font-weight: 700;
  opacity: 1;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #6dd5c0;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 rgba(0,0,0,0.25), 0 10px 22px rgba(0,0,0,0.20);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #fda632;
  background: #ffffff;
  box-shadow:
    0 4px 0 rgba(0,0,0,0.25),
    0 0 0 4px rgba(253,166,50,0.40);
}

/* radio / checkbox groups */
.group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 0 2px;
}

.group input[type="radio"],
.group input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1.5px solid #d6e4e7;
  background: #f4f9fa;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #3d5566;
  cursor: pointer;
  transition: all 160ms ease;
  user-select: none;
}

.chip:hover { border-color: #9bcdd4; color: #0c2952; }

.group input:checked + .chip {
  background: linear-gradient(135deg, #0c7e91, #0ab291);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(10,178,145,0.30);
}

/* ---------- Submit button — heartbeat ---------- */
.submit {
  margin-top: 14px;
  width: 100%;
  padding: 18px 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, #fda632 0%, #ffbf5e 100%);
  color: #ffffff;
  font-family: "Source Sans 3", "Myriad Pro", system-ui, sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  box-shadow:
    0 10px 24px rgba(253,166,50,0.40),
    0 2px 6px rgba(253,166,50,0.30);
  transition: transform 120ms ease, box-shadow 200ms ease;
  animation: heartbeat 1.6s ease-in-out infinite;
}

.submit:hover {
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 16px 36px rgba(253,166,50,0.50),
    0 3px 10px rgba(253,166,50,0.40);
}

.submit:active { transform: translateY(0) scale(0.99); }

@keyframes heartbeat {
  0%, 28%, 100% { transform: scale(1); }
  14%           { transform: scale(1.035); }
  42%           { transform: scale(1.020); }
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: #c8e0e6;
  text-align: center;
  font-weight: 600;
}

.disclaimer a {
  color: #6dd5c0;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}

.disclaimer a {
  color: #0c7e91;
  border-bottom: 1px solid currentColor;
  text-decoration: none;
}

/* ---------- Trust bar ---------- */
.trustbar {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
  color: #ffffff;
  z-index: 1;
}

.trustbar .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trustbar .num {
  font-family: "Source Sans 3", "Myriad Pro", system-ui, sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.18);
}

.trustbar .lbl {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.92;
}

/* ---------- Section divider inside card ---------- */
.section-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 10px;
  color: #6dd5c0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
}

.section-rule::before,
.section-rule::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(109,213,192,0.5), transparent);
}

/* ---------- Official logo (vertical white) on top of card ---------- */
.card-logo {
  display: block;
  width: 320px;
  max-width: 80%;
  height: auto;
  margin: 0 auto -56px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}

/* legacy — page-logo no longer rendered, kept in case it's reintroduced */
.page-logo {
  display: block;
  max-width: 220px;
  width: 60%;
  height: auto;
  margin: 0 auto 28px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.20));
  z-index: 1;
  position: relative;
}

/* ---------- Two-column rows (legacy, unused) ---------- */
.row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (max-width: 560px) {
  .page { padding: 24px 14px; }
  .card { padding: 36px 24px 32px; border-radius: 22px; }
  .title { font-size: 30px; }
  .subtitle { font-size: 15px; }
  .row-2 { grid-template-columns: 1fr; }
  .trustbar { gap: 12px; }
  .trustbar .num { font-size: 22px; }
  .trustbar .lbl { font-size: 10px; letter-spacing: 0.10em; }
}

/* ---------- Success state ---------- */
.success {
  text-align: center;
  padding: 24px 8px;
}

.success .check {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0c7e91, #0ab291);
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(10,178,145,0.35);
  animation: pop 600ms cubic-bezier(0.2, 0.9, 0.3, 1.5) both;
}

@keyframes pop {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.success h2 {
  font-family: "Source Sans 3", "Myriad Pro", system-ui, sans-serif;
  font-weight: 800;
  font-size: 28px;
  text-transform: uppercase;
  color: #ffffff;
  margin: 0 0 10px;
}

.success p {
  color: #c8e0e6;
  font-size: 15px;
  line-height: 1.55;
  margin: 0 auto;
  max-width: 420px;
  font-weight: 500;
}
