/* ══════════════════════════════════════════════
   Outreach Program — Candidate Form
   Aesthetic: Warm humanitarian, refined editorial
   Palette: Deep teal + warm amber + cream
══════════════════════════════════════════════ */

/* ── Variables ── */
:root {
  --teal-dark:    #1a4a47;
  --teal-mid:     #2d7a6f;
  --teal-light:   #4aada0;
  --amber:        #d4872a;
  --amber-light:  #f0b85a;
  --cream:        #faf7f2;
  --cream-dark:   #f0ebe0;
  --text-primary: #1c1a16;
  --text-secondary: #5a5348;
  --text-muted:   #8a8076;
  --border:       #d9d0c2;
  --border-focus: #2d7a6f;
  --error:        #c0392b;
  --error-bg:     #fdf2f0;
  --success:      #1a7a4a;
  --success-bg:   #f0faf5;
  --white:        #ffffff;
  --shadow-sm:    0 2px 8px rgba(26,74,71,0.08);
  --shadow-md:    0 8px 32px rgba(26,74,71,0.12);
  --shadow-lg:    0 20px 60px rgba(26,74,71,0.18);
  --radius:       12px;
  --radius-sm:    8px;
  --transition:   0.22s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.65;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26,74,71,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 24px;
}

.header-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--amber-light);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.brand-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--cream);
  padding: 7px 16px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.lang-btn:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.lang-btn svg { opacity: 0.75; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--teal-dark) 0%, #0f3330 60%, #1a2820 100%);
  padding: 80px 24px 90px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74,173,160,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 500px; height: 300px;
  background: radial-gradient(ellipse, rgba(212,135,42,0.08) 0%, transparent 65%);
  pointer-events: none;
}

.hero-content {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-light);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.1s forwards;
}

.hero-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.12;
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.2s forwards;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(250,247,242,0.7);
  max-width: 560px;
  opacity: 0;
  animation: fadeUp 0.6s ease 0.3s forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form Wrapper ── */
.form-wrapper {
  max-width: 820px;
  margin: -32px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/* ── Section Card ── */
.form-section {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 40px 40px 36px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  animation: sectionIn 0.5s ease forwards;
}

.form-section:nth-child(1) { animation-delay: 0.1s; }
.form-section:nth-child(2) { animation-delay: 0.18s; }
.form-section:nth-child(3) { animation-delay: 0.26s; }
.form-section:nth-child(4) { animation-delay: 0.34s; }
.form-section:nth-child(5) { animation-delay: 0.42s; }

@keyframes sectionIn {
  to { opacity: 1; transform: translateY(0); }
}

.final-section {
  background: linear-gradient(135deg, #fff9f0 0%, #fff 100%);
  border-color: var(--amber-light);
  border-width: 2px;
}

/* ── Section Header ── */
.section-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--cream-dark);
}

.section-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--teal-light);
  line-height: 1;
  flex-shrink: 0;
  min-width: 44px;
  padding-top: 2px;
}

.final-section .section-num {
  color: var(--amber);
  font-size: 1.6rem;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--teal-dark);
  line-height: 1.2;
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Fields Grid ── */
.fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 20px;
}

.field-group.full  { grid-column: 1 / -1; }
.field-group.half  { grid-column: span 1; }

/* ── Labels & Inputs ── */
.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.req {
  color: var(--amber);
  margin-left: 3px;
  font-weight: 700;
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.925rem;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.field-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}

.final-textarea { min-height: 130px; }

.field-input:focus,
.field-textarea:focus {
  border-color: var(--border-focus);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(45,122,111,0.12);
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Validation states */
.field-input.is-error,
.field-textarea.is-error {
  border-color: var(--error);
  background: var(--error-bg);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.09);
}

.field-input.is-valid,
.field-textarea.is-valid {
  border-color: var(--success);
  background: var(--success-bg);
}

.field-error {
  display: block;
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 5px;
  min-height: 18px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: all var(--transition);
}

.field-error.visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

/* ── Radio Group ── */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-group.wrap { gap: 10px 16px; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--cream);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  user-select: none;
}

.radio-label:hover {
  border-color: var(--teal-light);
  background: rgba(74,173,160,0.06);
  color: var(--teal-dark);
}

.radio-label input[type="radio"] { display: none; }

.radio-custom {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}

.radio-custom::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--white);
  transition: transform var(--transition);
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
  border-color: var(--teal-mid);
  background: var(--teal-mid);
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-label:has(input:checked) {
  border-color: var(--teal-mid);
  background: rgba(45,122,111,0.07);
  color: var(--teal-dark);
  font-weight: 500;
}

/* ── Checkbox Group ── */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.check-label {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--cream);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  user-select: none;
}

.checkbox-group.horizontal .check-label { padding: 8px 14px; align-items: center; }

.check-label:hover {
  border-color: var(--teal-light);
  background: rgba(74,173,160,0.06);
  color: var(--teal-dark);
}

.check-label input[type="checkbox"] { display: none; }

.check-custom {
  width: 18px; height: 18px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 2px solid var(--border);
  background: var(--white);
  transition: all var(--transition);
  position: relative;
  margin-top: 1px;
}

.checkbox-group.horizontal .check-custom { margin-top: 0; }

.check-custom::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 9px;
  border: 2.5px solid var(--white);
  border-top: none;
  border-left: none;
  transform: rotate(45deg) scale(0);
  transition: transform var(--transition);
}

.check-label input:checked ~ .check-custom {
  background: var(--teal-mid);
  border-color: var(--teal-mid);
}

.check-label input:checked ~ .check-custom::after {
  transform: rotate(45deg) scale(1);
}

.check-label:has(input:checked) {
  border-color: var(--teal-mid);
  background: rgba(45,122,111,0.07);
  color: var(--teal-dark);
  font-weight: 500;
}

/* ── Conditional Field ── */
.conditional-field {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.conditional-field.show {
  display: grid !important;
  animation: fadeUp 0.25s ease forwards;
}

/* ── Submit Area ── */
.submit-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 40px 0 60px;
}

.submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal-mid) 100%);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 16px 40px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(26,74,71,0.35);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  border-radius: inherit;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(26,74,71,0.42);
}

.submit-btn:active { transform: translateY(0); }

.submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-arrow {
  transition: transform var(--transition);
}

.submit-btn:hover .btn-arrow { transform: translateX(4px); }

.spin {
  animation: spin 0.8s linear infinite;
}

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

.submit-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Form Messages ── */
.form-message {
  width: 100%;
  max-width: 560px;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  text-align: center;
  display: none;
}

.form-message.error {
  display: block;
  background: var(--error-bg);
  border: 1px solid rgba(192,57,43,0.25);
  color: var(--error);
}

.form-message.success {
  display: block;
  background: var(--success-bg);
  border: 1px solid rgba(26,122,74,0.25);
  color: var(--success);
}

/* ── Success Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,74,71,0.55);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--white);
  border-radius: 20px;
  padding: 48px 44px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon {
  width: 72px; height: 72px;
  background: var(--success-bg);
  border: 2px solid rgba(26,122,74,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--success);
  margin: 0 auto 24px;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin-bottom: 12px;
}

.modal-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 28px;
}

.modal-close-btn {
  background: var(--teal-dark);
  color: var(--white);
  border: none;
  border-radius: 100px;
  padding: 12px 32px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.modal-close-btn:hover {
  background: var(--teal-mid);
  transform: translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .form-section { padding: 28px 20px 24px; }

  .fields-grid {
    grid-template-columns: 1fr;
  }

  .field-group.half { grid-column: 1 / -1; }

  .hero { padding: 60px 20px 70px; }

  .section-header { gap: 12px; }

  .radio-group { flex-direction: column; gap: 8px; }

  .radio-label { border-radius: var(--radius-sm); }

  .modal-box { padding: 36px 24px; }

  .submit-btn { padding: 14px 32px; }
}

@media (max-width: 400px) {
  .section-num { min-width: 36px; font-size: 1.7rem; }
  .section-title { font-size: 1.3rem; }
}

/* ── Nepali font boost ── */
[lang="ne"] .field-label,
[lang="ne"] .radio-label span:last-child,
[lang="ne"] .check-label span:last-child {
  letter-spacing: 0.01em;
}

/* ── Focus visible for accessibility ── */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--teal-light);
  outline-offset: 2px;
}
