/* Tutor application page, styled to match the home page and logo. */
:root {
  --ink: #232a33;
  --ink-4: #8b939b;
  --muted: #5d6670;
  --cream: #fffaf1;
  --white: #ffffff;
  --line: #efe6d6;
  --field: #e8e1d4;

  --pink: #fb5274;
  --yellow: #fbb404;
  --green: #73c39a;
  --blue: #2baaf3;

  --pink-soft: #ffe8ed;
  --yellow-soft: #fff3d1;
  --green-soft: #e3f4ea;
  --blue-soft: #e1f2fd;

  --pink-ink: #c7264a;
  --green-ink: #2c7a52;
  --blue-ink: #0d72ad;
  --danger: #d6334f;

  --display: "Fredoka", "Plus Jakarta Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

button { font: inherit; }

/* ── Top bar ─────────────────────────────── */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 250, 241, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
}

.tutor-nav {
  position: relative;
  display: flex;
  width: min(100%, 1200px);
  min-height: 76px;
  align-items: center;
  gap: 30px;
  margin: 0 auto;
  padding: 0 28px;
}

.tutor-logo-slot { display: block; width: 112px; height: 56px; margin-right: auto; }
.tutor-logo-slot img { width: 100%; height: 100%; object-fit: contain; }

.tutor-login {
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
}

.tutor-navlink { font-size: 15px; font-weight: 600; }
.tutor-navlink:hover { color: var(--blue-ink); }

.tutor-menu,
.tutor-menu-panel { display: none; }

/* ── Hero ────────────────────────────────── */
.tutor-hero { padding: 32px 0 8px; }

.tutor-hero-inner {
  display: grid;
  width: min(100%, 1200px);
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 48px;
  margin: 0 auto;
  padding: 0 28px;
}

.brand-dots { display: flex; gap: 8px; margin-bottom: 20px; }
.brand-dots i { width: 14px; height: 14px; border-radius: 50%; }
.brand-dots i:nth-child(1) { background: var(--pink); }
.brand-dots i:nth-child(2) { background: var(--yellow); }
.brand-dots i:nth-child(3) { background: var(--green); }
.brand-dots i:nth-child(4) { background: var(--blue); }

.application-heading h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(40px, 5.4vw, 64px);
  font-weight: 600;
  line-height: 1.08;
}

.hero-highlight {
  padding-bottom: 0.16em;
  color: var(--pink);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M4 5 Q100 26 196 5' fill='none' stroke='%23fbb404' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E") left bottom / 100% 0.3em no-repeat;
}

.application-heading > p { max-width: 44ch; margin: 0 0 32px; color: var(--muted); font-size: 18px; }

/* Step tracker */
.step-progress {
  display: flex;
  max-width: 520px;
  align-items: flex-start;
  padding: 20px 24px;
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 2px 0 var(--line);
}

.step-dot { display: grid; flex: none; justify-items: center; gap: 8px; width: 92px; text-align: center; }

.step-dot-circle {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 3px solid var(--field);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}

.step-dot-label { color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.3; }

.step-dot.active .step-dot-circle { border-color: var(--pink); background: var(--pink); color: var(--white); }
.step-dot.active .step-dot-label { color: var(--pink-ink); }
.step-dot.done .step-dot-circle { border-color: var(--green); background: var(--green); color: var(--white); }
.step-dot.done .step-dot-circle span { display: none; }
.step-dot.done .step-dot-circle::after { content: "✓"; }
.step-dot.done .step-dot-label { color: var(--green-ink); }

.step-connector {
  flex: 1;
  height: 4px;
  min-width: 16px;
  margin-top: 20px;
  border-radius: 4px;
  background: var(--field);
}

.step-connector.done { background: var(--green); }

/* Illustration */
.tutor-art-slot { position: relative; padding: 20px; }
.tutor-art-slot img { position: relative; z-index: 1; display: block; width: 100%; height: auto; }
.blob { position: absolute; border-radius: 50%; }
.blob-yellow { top: 0; right: 4%; width: 62%; aspect-ratio: 1; background: var(--yellow-soft); }
.blob-green { bottom: 4%; left: 2%; width: 34%; aspect-ratio: 1; background: var(--green-soft); }

/* ── Form ────────────────────────────────── */
.application {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 40px 28px 96px;
}

.form-card {
  border-radius: 36px;
  background: var(--white);
  box-shadow: 0 2px 0 var(--line), 0 24px 48px rgba(35, 42, 51, 0.06);
}

.form-card-inner { padding: 44px 48px 48px; }

/* All three panels are shown as one long form, each in its own section. */
.step-panel { display: block; }
.step-panel + .step-panel { margin-top: 40px; padding-top: 36px; border-top: 2px dashed var(--line); }

.step-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }

.step-heading::before {
  display: grid;
  flex: none;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
}

#step-1 .step-heading::before { content: "1"; background: var(--pink-soft); color: var(--pink-ink); }
#step-2 .step-heading::before { content: "2"; background: var(--yellow-soft); color: #8a6200; }
#step-3 .step-heading::before { content: "3"; background: var(--green-soft); color: var(--green-ink); }

.step-heading strong { font-family: var(--display); font-size: 24px; font-weight: 600; }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.tutor-personal-row { grid-template-columns: minmax(0, 1fr) 140px; }
.tutor-education-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tutor-location-row > .field-error { grid-column: 1 / -1; margin-top: -12px; margin-bottom: 18px; }

.form-group { min-width: 0; margin-bottom: 20px; }

.form-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.req { color: var(--pink); }

.form-input,
.form-select {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 2px solid var(--field);
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-input::placeholder { color: var(--ink-4); }

.form-input:focus,
.form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); outline: none; }

.form-input.error { border-color: var(--danger); }

textarea.form-input { min-height: 110px; resize: vertical; }

.field-error { display: none; margin-top: 6px; color: var(--danger); font-size: 13px; font-weight: 600; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  min-height: 42px;
  padding: 8px 16px;
  border: 2px solid var(--field);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.chip:hover { border-color: var(--blue); }
.chip.selected { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-ink); }

/* Custom dropdown */
.state-select { position: relative; }

.state-select-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.state-select-button > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevron { color: var(--muted); transition: transform 140ms ease; }
.state-select.open .chevron { transform: rotate(180deg); }
.state-select.open .state-select-button { border-color: var(--blue); }

.state-select-menu {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 16px 32px rgba(35, 42, 51, 0.12);
}

.state-select-menu.show { display: grid; }

.state-select-menu button {
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.state-select-menu button:hover { background: var(--cream); }
.state-select-menu button.selected { background: var(--blue-soft); color: var(--blue-ink); font-weight: 700; }

/* Photo upload */
.photo-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.photo-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin-right: 12px;
  padding: 0 20px;
  border: 2px dashed var(--blue);
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  font-weight: 700;
  cursor: pointer;
}

.photo-input:focus-visible + .photo-name,
.photo-upload:hover { background: #cfe9fb; }

.photo-name { color: var(--muted); font-size: 14px; }
.tutor-photo-group .form-label { margin-bottom: 10px; }

/* Subjects */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.subject-category {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 22px;
  background: var(--cream);
}

.subject-category legend {
  float: left;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

.subject-category .chip { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.other-subject-label { width: 100%; margin-top: 6px; font-size: 13px; font-weight: 700; }
.other-subject { min-height: 44px; }

/* Agreement + submit */
.agreement {
  display: grid;
  gap: 10px;
  margin: 8px 0 28px;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--yellow-soft);
  font-size: 14px;
}

.agreement label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.agreement input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pink); }
.agreement a { color: var(--pink-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

.form-nav { display: flex; justify-content: flex-end; }

.btn-next,
.btn-home {
  display: inline-flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  box-shadow: 0 5px 0 #d99a00;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.btn-next:hover,
.btn-home:hover { transform: translateY(2px); box-shadow: 0 3px 0 #d99a00; }
.btn-next:disabled { opacity: 0.6; cursor: wait; transform: none; }

/* Success */
.success-screen { display: none; padding: 32px 0 16px; text-align: center; }
.success-screen.show { display: block; }

.success-icon {
  display: grid;
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 40px;
  font-weight: 700;
}

.success-screen h3 { margin: 0 0 8px; font-family: var(--display); font-size: 30px; font-weight: 600; }
.success-screen p { max-width: 40ch; margin: 0 auto 28px; color: var(--muted); }

/* ── Footer ──────────────────────────────── */
.site-footer {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-radius: 48px 48px 0 0;
  background: var(--white);
  color: var(--muted);
  box-shadow: 0 -12px 40px rgba(35, 42, 51, 0.04);
}

.footer-inner {
  display: grid;
  width: min(100%, 1200px);
  grid-template-columns: minmax(0, 1fr) repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr);
  gap: 32px;
  margin: 0 auto;
  padding: 64px 28px calc(64px + env(safe-area-inset-bottom, 0px));
}

/* Logo with the smile drawn underneath it, so the two always stay together. */
.footer-logo-slot {
  position: relative;
  width: 132px;
  height: 66px;
  margin-bottom: 30px;
}
.footer-logo-slot::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -26px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 30'%3E%3Cpath d='M8 6 Q66 44 124 6' fill='none' stroke='%23fbb404' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.footer-links { display: grid; align-content: start; justify-items: start; gap: 10px; }

.footer-links h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}

.footer-links a { font-size: 15px; }
.footer-links a:hover { color: var(--pink-ink); }

.footer-legal {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

/* WhatsApp button */
.whatsapp-btn {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #25d366;
  font-size: 26px;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 900px) {
  .tutor-nav { gap: 12px; min-height: 64px; padding: 0 16px; }
  .tutor-logo-slot { width: 96px; height: 48px; }
  .tutor-login { display: none; }

  .tutor-menu {
    display: flex;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    cursor: pointer;
  }

  .tutor-menu span { width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }

  .tutor-menu-panel:not([hidden]) {
    position: absolute;
    top: calc(100% + 6px);
    right: 16px;
    display: grid;
    min-width: 200px;
    gap: 2px;
    padding: 8px;
    border: 2px solid var(--line);
    border-radius: 18px;
    background: var(--white);
    box-shadow: 0 16px 32px rgba(35, 42, 51, 0.14);
  }

  .tutor-menu-panel a { padding: 10px 12px; border-radius: 10px; font-size: 15px; font-weight: 600; }
  .tutor-menu-panel a:hover { background: var(--cream); }

  .tutor-hero { padding-top: 16px; }
  .tutor-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0 16px; text-align: center; }
  .brand-dots { justify-content: center; }
  .application-heading > p { margin-left: auto; margin-right: auto; }
  .step-progress { margin: 0 auto; }
  .tutor-art-slot { order: -1; max-width: 360px; width: 100%; margin: 0 auto; padding: 8px; }

  .application { padding: 28px 16px 80px; }
  .form-card { border-radius: 28px; }
  .form-card-inner { padding: 28px 20px 32px; }
  .tutor-education-row { grid-template-columns: minmax(0, 1fr); }

  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; padding: 48px 20px calc(80px + env(safe-area-inset-bottom, 0px)); }
  .footer-inner .footer-logo-slot { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .application-heading h1 { font-size: 38px; }
  .application-heading > p { font-size: 16px; }
  .step-progress { padding: 16px 12px; }
  .step-dot { width: 72px; }
  .step-dot-circle { width: 38px; height: 38px; font-size: 16px; }
  .step-connector { margin-top: 17px; }
  .form-row,
  .tutor-personal-row { grid-template-columns: minmax(0, 1fr); }
  .subject-grid { grid-template-columns: minmax(0, 1fr); }
  .form-nav { justify-content: stretch; }
  .btn-next { width: 100%; }
  .photo-name { display: block; margin-top: 8px; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .footer-contact { grid-column: 1 / -1; }
  .footer-links a { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.lang-switch button {
  padding: 4px 11px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] { background: var(--yellow); color: var(--ink); }
.mobile-lang { justify-self: start; margin: 4px 8px; }

@media (max-width: 900px) {
  .tutor-nav > .lang-switch,
  .tutor-navlink { display: none; }
}

/* Nav links centred on the page (logo left, buttons right). */
.nav-center { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.nav-center + .lang-switch { margin-left: auto; }
@media (min-width: 1180px) {
  .tutor-nav { position: relative; }
  .nav-center { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; }
}
@media (max-width: 900px) { .nav-center { display: none; } }

/* Header after scrolling: white with a soft shadow, like the footer. */
.topbar-wrap { transition: background-color 200ms ease, box-shadow 200ms ease; }
.topbar-wrap.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 0 var(--line), 0 12px 40px rgba(35, 42, 51, 0.06);
}

.footer-logo-slot { display: block; flex: none; }
.footer-logo-slot img { width: 100%; height: 100%; object-fit: contain; }
