/* ============================================
   Unified biipolar recruitment funnel
   ============================================ */

:root {
  --bp-blue: #0073CE;
  --bp-red: #E84C5E;
  --bp-black: #111111;
  --bp-button-blue: #1E5FA6;
  --bp-white: #FFFFFF;
  --bp-text: #333333;
  --bp-muted: #888888;
  --bp-gray-light: #E5E7EB;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  background-color: #ffffff;
  color: var(--bp-text);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

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

button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Prevent iOS auto-zoom on input focus (font-size must be ≥16px) */
input, textarea, select, button {
  font: inherit;
  font-size: 16px;
}

/* iOS input reset */
input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

h1, h2, h3, h4 { line-height: 1.2; }
p { line-height: 1.6; }

/* ---- Screen show/hide + transitions ---- */
.screen { display: none; }
.screen.active { display: block; }

.screen.fade-in-right { animation: fadeInRight 0.3s ease forwards; }
.screen.fade-out-left { animation: fadeOutLeft 0.3s ease forwards; }
.screen.fade-in-left  { animation: fadeInLeft  0.3s ease forwards; }
.screen.fade-out-right{ animation: fadeOutRight 0.3s ease forwards; }

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOutLeft {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-30px); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOutRight {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(30px); }
}

/* ---- Unified top bar: back arrow + progress ---- */
.survey-top-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #ffffff;
  width: 100%;
  border-bottom: 1px solid #f1f3f6;
}
.survey-top-bar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  max-width: 640px;
  margin: 0 auto;
}
.back-arrow {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 22px;
  line-height: 1;
  color: var(--bp-black);
  border-radius: 6px;
  transition: background 0.15s ease;
}
.back-arrow:hover { background: #f1f3f6; }

.progress-bar-container {
  width: 100%;
  height: 5px;
  background: var(--bp-gray-light);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--bp-red);
  width: 0%;
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease;
}

/* ============================================
   Landing page (keep Stitch design, retinted)
   ============================================ */
.screen-landing { background: #f3f4f6; }
.screen-landing .main-container {
  max-width: 600px;
  margin: 0 auto;
  background-color: #ffffff;
  min-height: 100vh;
}
.screen-landing .full-bleed { width: 100%; display: block; }

/* Tailwind generates font-size: 11px for .text-\[11px\].
   Upscale to 13px on wider screens for readability. */
@media (max-width: 991px) {
  .text-\[11px\] { font-size: 11px !important; }
}
@media (min-width: 992px) {
  html { font-size: 18px; }
  .screen-landing .main-container { max-width: 960px; }
  .text-\[11px\] { font-size: 13px !important; }
}

/* ============================================
   UNIFIED SURVEY TEMPLATE (Q1–Q5)
   ============================================ */
.survey-screen {
  background: #ffffff;
  min-height: 100vh;
  min-height: 100dvh;
}
.survey-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  text-align: center;
}
.survey-step {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bp-muted);
  margin-bottom: 20px;
}
.survey-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--bp-black);
  line-height: 1.25;
  margin: 0 0 12px 0;
}
.survey-subtitle {
  font-size: 0.95rem;
  color: var(--bp-muted);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.survey-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 32px;
}
.survey-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 20px;
  min-height: 84px;
  background: var(--bp-black);
  color: var(--bp-white);
  border: 2px solid var(--bp-black);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.survey-option:hover {
  background: var(--bp-button-blue);
  border-color: var(--bp-button-blue);
}
.survey-option:active { transform: scale(0.98); }
.survey-option.selected {
  background: var(--bp-button-blue);
  border-color: var(--bp-button-blue);
}

/* Multi-select checkbox indicator (Q4) */
.survey-option .check-box {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.survey-option .check-box::after {
  content: "✓";
  color: var(--bp-button-blue);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.survey-option.selected .check-box {
  background: var(--bp-white);
  border-color: var(--bp-white);
}
.survey-option.selected .check-box::after { opacity: 1; }

/* Free-text textarea (Q5) */
.survey-textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px;
  border: 2px solid var(--bp-gray-light);
  border-radius: 10px;
  background: #ffffff;
  color: var(--bp-text);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}
.survey-textarea:focus {
  outline: none;
  border-color: var(--bp-button-blue);
}
.survey-textarea::placeholder { color: var(--bp-muted); }

/* Weiter button (Q4, Q5) */
.weiter-btn {
  width: 100%;
  padding: 18px 24px;
  background: var(--bp-button-blue);
  color: var(--bp-white);
  border: none;
  border-radius: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.weiter-btn:hover:not([disabled]) { opacity: 0.92; }
.weiter-btn:active:not([disabled]) { transform: scale(0.98); }
.weiter-btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--bp-muted);
}
.weiter-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--bp-muted);
  text-align: center;
}

/* Desktop 2-column grid */
@media (min-width: 640px) {
  .survey-options.two-col { grid-template-columns: 1fr 1fr; }
  .survey-title { font-size: 2rem; }
  .survey-container { padding: 56px 24px 80px; }
}

/* ============================================
   Contact form
   ============================================ */
.form-field { position: relative; }
.form-field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--bp-gray-light);
  padding: 12px 0;
  font-size: 1.1rem;
  font-family: 'Inter', sans-serif;
  color: var(--bp-text);
  transition: border-color 0.2s ease;
}
.form-field input:focus {
  outline: none;
  border-bottom-color: var(--bp-button-blue);
}
.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--bp-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field-error {
  color: #ba1a1a;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}
.has-error input { border-bottom-color: #ba1a1a !important; }
.has-error .field-error { display: block; }

.submit-btn {
  width: 100%;
  padding: 18px 24px;
  background: var(--bp-red);
  color: var(--bp-white);
  border: none;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 40px rgba(232, 76, 94, 0.15);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.submit-btn:hover { opacity: 0.92; }
.submit-btn:active { transform: scale(0.97); }

/* ============================================
   Thank-you screen
   ============================================ */
.screen-thankyou {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.screen-thankyou .ty-inner { max-width: 520px; }
.screen-thankyou h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--bp-black);
  margin-bottom: 1rem;
}
.screen-thankyou p {
  font-size: 1.05rem;
  color: var(--bp-text);
}
.screen-thankyou .ty-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bp-red);
  color: var(--bp-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 40px;
  font-weight: 800;
}
.home-btn {
  margin-top: 32px;
  padding: 16px 32px;
  background: var(--bp-black);
  color: var(--bp-white);
  border: none;
  border-radius: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.home-btn:hover { opacity: 0.9; }

/* ============================================
   Rejection screen
   ============================================ */
.rejection-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: var(--bp-text);
  font-family: 'Inter', sans-serif;
}
.rejection-wrap header {
  padding: 32px 24px;
  text-align: center;
}
.rejection-wrap header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bp-black);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
}
.rejection-main {
  flex-grow: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 24px 64px;
  text-align: center;
}
.rejection-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 32px;
  border-radius: 50%;
  background: var(--bp-gray-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bp-muted);
  font-size: 28px;
}
.rejection-main h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--bp-black);
  margin: 0 0 16px;
}
.rejection-main .lead {
  font-size: 1.05rem;
  color: var(--bp-muted);
  margin-bottom: 32px;
}
.rejection-note {
  background: #f8f9fb;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0 40px;
}
.rejection-note .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--bp-red);
  margin-bottom: 8px;
}
.rejection-note p { margin: 0; font-size: 0.9rem; color: var(--bp-muted); }

/* ============================================
   Mobile / tablet tweaks
   ============================================ */
@media (max-width: 480px) {
  .survey-top-bar-inner { padding: 8px 12px; }
  .survey-title { font-size: 1.5rem; }
  .survey-container { padding: 32px 16px 64px; }
  .screen-thankyou h1 { font-size: 1.6rem; }
  .rejection-main h2 { font-size: 1.6rem; }
}

/* Tablet portrait (iPad) */
@media (min-width: 481px) and (max-width: 834px) {
  .survey-container { max-width: 560px; }
}

/* Ensure tap targets are comfortable on touch devices */
@media (hover: none) and (pointer: coarse) {
  .survey-option { min-height: 88px; }
  .back-arrow { padding: 10px 14px; font-size: 24px; }
  .weiter-btn, .submit-btn, .home-btn { min-height: 52px; }
  /* Kill the hover-blue on touch (only selected state should be blue) */
  .survey-option:hover:not(.selected) {
    background: var(--bp-black);
    border-color: var(--bp-black);
  }
}

/* Landscape phones: reduce vertical padding */
@media (max-height: 500px) and (orientation: landscape) {
  .survey-container { padding: 20px 16px 40px; }
  .survey-title { font-size: 1.35rem; margin-bottom: 8px; }
  .survey-subtitle { margin-bottom: 20px; }
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Aspect-ratio fallback for iOS Safari < 15 (landing images) */
@supports not (aspect-ratio: 1) {
  .aspect-\[3\/2\] { position: relative; padding-bottom: 66.666%; height: 0; overflow: hidden; }
  .aspect-\[3\/2\] > img,
  .aspect-\[16\/9\] > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
  .aspect-\[16\/9\] { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
  img.aspect-\[3\/2\] { aspect-ratio: auto; width: 100%; height: auto; }
  img.aspect-\[16\/9\] { aspect-ratio: auto; width: 100%; height: auto; }
}
