/* ═══════════════════════════════════════
   DFS-CV — Mobile-first styles
   ═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --red: #EE1000;
  --red-dark: #c50d00;
  --red-light: #fff0ef;
  --cream: #F7EAE1;
  --cream-dark: #efe0d5;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --green: #10b981;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
}

body {
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--cream);
  color: var(--gray-900);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ═══ TRUST BANNER ═══ */
#trust-banner {
  background: var(--gray-900);
  color: var(--cream);
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ═══ HEADER ═══ */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { height: 36px; width: auto; max-width: 110px; object-fit: contain; border-radius: 0; }
.header-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
}
.header-right { display: flex; gap: 4px; }
.lang-btn {
  background: none;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-500);
  transition: all 0.15s;
}
.lang-btn:hover { border-color: var(--gray-400); color: var(--gray-700); }
.lang-btn.active {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-light);
}

/* ═══ PROGRESS BAR ═══ */
#progress-bar {
  background: var(--white);
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  position: relative;
}
#progress-steps {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  margin-bottom: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#progress-steps::-webkit-scrollbar { display: none; }
.progress-step {
  font-size: 11px;
  font-weight: 500;
  color: var(--gray-400);
  white-space: nowrap;
  padding: 2px 6px;
  border-radius: 10px;
  transition: all 0.2s;
  cursor: default;
  flex-shrink: 0;
}
.progress-step.active { color: var(--red); font-weight: 700; }
.progress-step.done { color: var(--green); }
#progress-fill {
  height: 3px;
  background: var(--gray-200);
  border-radius: 2px;
  overflow: hidden;
}
#progress-fill::after {
  content: '';
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  width: var(--progress, 10%);
  transition: width 0.3s ease;
}

/* ═══ WIZARD (main) ═══ */
#wizard {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* ═══ STEP ═══ */
.step { display: none; }
.step.active { display: block; }
.step-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 24px;
}

/* ═══ FORM FIELDS ═══ */
.field-group { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.field-label .opt {
  font-weight: 400;
  color: var(--gray-400);
  font-size: 12px;
  margin-left: 4px;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 16px;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(238,16,0,0.08);
}
.field-input.error,
.field-select.error {
  border-color: var(--red);
  background: var(--red-light);
}
.field-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}
.field-input.error + .field-error,
.field-select.error + .field-error { display: block; }

.field-textarea { resize: vertical; min-height: 100px; }

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239ca3af' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Row layout for inline fields */
.field-row {
  display: flex;
  gap: 12px;
}
.field-row > .field-group { flex: 1; }

/* Date triple */
.date-row { display: flex; gap: 8px; }
.date-row .field-select { flex: 1; }
.date-row .field-select:first-child { flex: 0.7; }

/* Radio group */
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 14px;
}
.radio-option:hover { border-color: var(--gray-400); }
.radio-option.selected {
  border-color: var(--red);
  background: var(--red-light);
  color: var(--red);
  font-weight: 600;
}
.radio-option input[type="radio"] { display: none; }

/* Repeating section */
.repeating-section { margin-bottom: 16px; }
.repeating-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  position: relative;
}
.repeating-item .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.repeating-item .remove-btn:hover { color: var(--red); background: var(--red-light); }
.add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  justify-content: center;
}
.add-btn:hover { border-color: var(--red); color: var(--red); }

/* Photo upload */
.photo-upload {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.15s;
}
.photo-upload:hover { border-color: var(--red); }
.photo-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--gray-400);
  overflow: hidden;
  flex-shrink: 0;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload-text {
  font-size: 14px;
  color: var(--gray-500);
}
.photo-upload-text strong {
  display: block;
  color: var(--red);
  font-weight: 600;
}

/* ═══ BOTTOM BAR ═══ */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}

/* ═══ BUTTONS ═══ */
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--red);
  color: var(--white);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-outline {
  background: none;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--gray-400); }
.btn-ghost {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 13px;
}
.btn-ghost:hover { color: var(--gray-700); }

/* ═══ MODAL ═══ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}
.modal-box h2 { font-size: 20px; margin-bottom: 8px; }
.modal-box p { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ═══ TOAST ═══ */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 1001;
  transition: opacity 0.3s;
}
#toast.hidden { opacity: 0; pointer-events: none; }

/* ═══ SUCCESS SCREEN ═══ */
#success-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 24px;
}
.success-box { text-align: center; max-width: 400px; }
.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.success-box h1 { font-size: 28px; margin-bottom: 8px; }
.success-box p { color: var(--gray-500); font-size: 16px; }
.success-id { margin-top: 24px; font-size: 14px; color: var(--gray-500); }
.success-id strong { color: var(--gray-900); font-family: monospace; }

/* ═══ COMING SOON PLACEHOLDER ═══ */
.coming-soon {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-400);
}
.coming-soon-icon { font-size: 48px; margin-bottom: 16px; }
.coming-soon-text { font-size: 18px; font-weight: 500; }

/* ═══ ERROR HIGHLIGHT ═══ */
.error-highlight {
  outline: 2px solid var(--red);
  border-radius: 6px;
}

/* ═══ REPEATING CARDS ═══ */
.repeating-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
}
.repeating-card .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}
.repeating-card .remove-btn:hover { color: var(--red); }

.subsection-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-700);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-100);
}

.empty-hint {
  color: var(--gray-400);
  text-align: center;
  padding: 32px 16px;
  font-style: italic;
}

/* ═══ LANGUAGE CEFR GRID ═══ */
.lang-card { padding: 20px 16px; }
.cefr-grid { margin-top: 12px; }
.cefr-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cefr-label {
  width: 100px;
  font-size: 13px;
  color: var(--gray-500);
  flex-shrink: 0;
}
.cefr-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.cefr-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 16px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray-700);
  transition: all 0.15s;
}
.cefr-chip:hover { border-color: var(--red); color: var(--red); }
.cefr-chip.selected {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.quick-set {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
  font-size: 12px;
  color: var(--gray-400);
}
.chip-mini {
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 11px;
  cursor: pointer;
  color: var(--gray-500);
}
.chip-mini:hover { background: var(--red-light); border-color: var(--red); color: var(--red); }

/* ═══ SKILLS TAGS ═══ */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 16px;
  background: var(--cream);
  color: var(--gray-700);
  font-size: 13px;
}
.tag-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}
.tag-remove:hover { color: var(--red); }
.tag-input {
  border: none;
  outline: none;
  font-size: 14px;
  min-width: 80px;
  flex: 1;
  padding: 4px;
  font-family: inherit;
}

/* ═══ CHECKBOX GRID (driving) ═══ */
.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
}

/* ═══ CONSENT ═══ */
.consent-group { margin-top: 24px; }
.consent-label span { font-size: 14px; line-height: 1.5; }

/* ═══ CHAR COUNTER ═══ */
.char-counter {
  font-size: 12px;
  color: var(--gray-400);
  text-align: right;
  margin-top: 4px;
}

/* ═══ REMOVE INLINE (for simple rows) ═══ */
.remove-inline {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
}
.remove-inline:hover { color: var(--red); }

/* ═══ FIELD HINT ═══ */
.field-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 8px;
}

/* ═══ FILE BUTTON ═══ */
.file-btn {
  cursor: pointer;
  display: inline-block;
}

/* ═══ HIDDEN ═══ */
.hidden { display: none !important; }

/* ═══ RESPONSIVE ═══ */
@media (min-width: 1024px) {
  #wizard { padding: 32px 24px; }
  .field-row-desktop { display: flex; gap: 16px; }
  .field-row-desktop > .field-group { flex: 1; }
}
