@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --navy:        #1a2550;
  --navy-deep:   #111c3d;
  --navy-mid:    #2d3e7a;
  --blue-globe:  #3b7cc4;
  --orange:      #e8891e;
  --orange-glow: rgba(232, 137, 30, 0.3);
  --page-bg:     #eaecf5;
  --body-bg:     #f2f3f9;
  --card-bg:     #ffffff;
  --text-dark:   #1a1f36;
  --text-mid:    #4e5470;
  --text-muted:  #8890ab;
  --border:      #e1e4f0;
  --error:       #c0392b;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --shadow-sm:   0 1px 4px rgba(26, 37, 80, 0.07), 0 1px 2px rgba(26, 37, 80, 0.04);
  --shadow-md:   0 4px 20px rgba(26, 37, 80, 0.10), 0 2px 6px rgba(26, 37, 80, 0.05);
  --shadow-lg:   0 8px 36px rgba(26, 37, 80, 0.13), 0 3px 10px rgba(26, 37, 80, 0.07);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: linear-gradient(150deg, #edf0f8 0%, #e4e8f4 100%);
  background-attachment: fixed;
  min-height: 100vh;
  padding: 44px 16px 80px;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

.page-wrapper {
  max-width: 700px;
  margin: 0 auto;
}

/* ── Outer form card ──────────────────────────── */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ── Header ──────────────────────────────────── */
.form-header {
  background: var(--card-bg);
  text-align: center;
  padding: 44px 32px 34px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

/* Thin brand stripe — navy → globe blue — at top */
.form-header::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, var(--navy-deep) 0%, var(--navy-mid) 55%, var(--blue-globe) 100%);
}

.header-logo {
  margin-bottom: 22px;
}

.header-logo img {
  height: 56px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.form-header h1 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
}

.form-header .subtitle {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ── Form body background ─────────────────────── */
#questionnaire-form {
  background: var(--body-bg);
  padding-top: 8px;
  padding-bottom: 4px;
}

/* ── Question cards ───────────────────────────── */
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 14px 16px;
  padding: 26px 24px 22px;
  border-left: 3px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.question-card:focus-within {
  box-shadow: var(--shadow-md);
  border-left-color: var(--orange);
}

.question-card.error {
  border-left-color: var(--error) !important;
}

.question-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 18px;
  line-height: 1.6;
}

.required {
  color: var(--error);
}

/* ── Contact fields ──────────────────────────── */
.contact-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.contact-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.contact-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #fafbfd;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.contact-field input:focus {
  outline: none;
  border-color: var(--navy);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26, 37, 80, 0.07);
}

.contact-field input::placeholder {
  color: var(--text-muted);
}

.question-card.error .contact-field input:invalid,
.question-card.error .contact-field input:placeholder-shown {
  border-color: var(--error);
}

@media (max-width: 600px) {
  .contact-fields {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* ── Option rows ─────────────────────────────── */
.options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option {
  display: flex;
  flex-direction: column;
}

.option label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-mid);
  line-height: 1.5;
  transition: background-color 0.18s, color 0.18s;
  user-select: none;
}

.option label:hover {
  background-color: #edf1fb;
  color: var(--navy);
}

input[type="radio"],
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--navy);
  flex-shrink: 0;
  margin: 0;
}

/* ── "Other" text input ───────────────────────── */
.other-input {
  display: block;
  width: calc(100% - 42px);
  margin: 2px 0 6px 42px;
  padding: 7px 4px;
  border: none;
  border-bottom: 1.5px solid var(--border);
  outline: none;
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-dark);
  background: transparent;
  transition: border-color 0.2s;
}

.other-input:focus {
  border-bottom: 2px solid var(--orange);
}

.other-input.hidden {
  display: none;
}

/* ── Textarea (Q9) ───────────────────────────── */
.question-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text-dark);
  resize: vertical;
  min-height: 120px;
  line-height: 1.65;
  background: #fafbfd;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.question-card textarea:focus {
  outline: none;
  border-color: var(--navy);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26, 37, 80, 0.07);
}

.question-card textarea::placeholder {
  color: var(--text-muted);
}

/* ── Validation error ─────────────────────────── */
.error-message {
  display: none;
  color: var(--error);
  font-size: 0.775rem;
  margin-top: 10px;
  padding-left: 2px;
}

.question-card.error .error-message {
  display: block;
}

/* ── Submit area ──────────────────────────────── */
.submit-area {
  background: var(--body-bg);
  padding: 14px 16px 44px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

#submit-btn {
  background: var(--navy);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 40px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 10px rgba(26, 37, 80, 0.28);
  transition: background-color 0.22s, box-shadow 0.22s, transform 0.1s;
}

#submit-btn:hover:not(:disabled) {
  background: var(--orange);
  box-shadow: 0 4px 18px var(--orange-glow);
}

#submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

#submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.privacy-note {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* ── Spinner ─────────────────────────────────── */
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Thank You ───────────────────────────────── */
#thank-you {
  padding: 68px 28px 76px;
  text-align: center;
  background: var(--card-bg);
}

#thank-you.hidden {
  display: none;
}

.ty-icon {
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, #dde6ff 0%, #cfd8f7 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
  box-shadow: 0 4px 18px rgba(26, 37, 80, 0.14);
}

#thank-you h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

#thank-you p {
  font-size: 0.9375rem;
  color: var(--text-mid);
  line-height: 1.75;
  max-width: 360px;
  margin: 0 auto;
}

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 600px) {
  body {
    padding: 0 0 60px;
  }

  .form-card {
    border-radius: 0;
    box-shadow: none;
  }

  .form-header {
    padding: 34px 20px 26px;
  }

  .header-logo img {
    height: 46px;
  }

  .question-card {
    margin: 12px 10px;
    padding: 22px 16px 18px;
  }

  .submit-area {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 10px 40px;
  }

  #submit-btn {
    justify-content: center;
    padding: 14px;
  }
}
