/* styles.css — formular intake Bellodent. Mobile-first, design tokens din brief. */

:root {
  --primary: #44C8F3;
  --primary-strong: #1487B8;   /* text/butoane pe primar, pentru contrast */
  --primary-hover: #2ab5e0;
  --error: #e74c3c;
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #666;
  --muted-2: #888;
  --border: #d0d7de;
  --radius-card: 12px;
  --radius-input: 8px;
  --container: 480px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  padding: env(safe-area-inset-top) 0 calc(env(safe-area-inset-bottom) + 24px);
}

.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 12px 12px 0;
}

/* ---------- Utilitare ---------- */
.is-hidden { display: none !important; }

/* Honeypots: invizibile vizual și pentru cititoare de ecran, fără display:none
   (unele boți evită câmpurile cu display:none). */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 18px 16px;
  margin-bottom: 14px;
}

/* ---------- Header ---------- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 12px;
}
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 34px; width: auto; }

.lang-switcher { display: flex; gap: 4px; }
.lang-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}
.lang-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Intro + progres ---------- */
.intro { border-top: 4px solid var(--primary); }
.intro-title { font-size: 20px; }
.intro-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.progress {
  display: flex;
  gap: 6px;
  list-style: none;
  margin-top: 14px;
}
.progress-step {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e4eaf0;
  transition: background 0.2s;
}
.progress-step.done { background: var(--primary); }

/* ---------- Secțiuni / titluri ---------- */
.section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* ---------- Câmpuri ---------- */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
label.required::after {
  content: " *";
  color: var(--error);
}
.opt { color: var(--muted-2); font-weight: 400; font-size: 13px; }

/* Stilul de „input box" se aplică DOAR câmpurilor text/select, NU checkbox/radio. */
input:not([type=checkbox]):not([type=radio]), select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px; /* anti-zoom iOS */
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  min-height: 46px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 56px; line-height: 1.45; }

input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(68, 200, 243, 0.25);
}

/* Checkbox/radio: aspect nativ curat, doar culoarea de accent. Fără border,
   padding, transition sau glow care le făceau să „pulseze" la click. */
input[type=checkbox], input[type=radio] {
  appearance: auto;
  accent-color: var(--primary-strong);
  width: 18px;
  height: 18px;
  min-height: 0;
  flex: 0 0 auto;
  cursor: pointer;
}

/* Stare eroare */
.field.has-error input,
.field.has-error select,
.field.has-error textarea,
input.has-error, select.has-error, textarea.has-error {
  border-color: var(--error);
}
.error {
  display: none;
  color: var(--error);
  font-size: 13px;
  margin-top: 5px;
}
.field.has-error .error,
.error.show { display: block; }

/* ---------- Telefon ---------- */
.phone-row { display: flex; gap: 8px; }
.phone-row input#telefon { flex: 1; min-width: 0; }

/* Dropdown editabil pentru codul de țară. Lățime fixă mică; numărul ia restul. */
.combo { position: relative; flex: 0 0 96px; }
.phone-cc { width: 100%; text-align: center; padding-right: 22px; }
.combo::after {
  content: "▾";
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
  font-size: 12px;
}
.combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 210px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
  max-height: 260px;
  overflow: auto;
}
.combo-opt {
  padding: 11px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  white-space: nowrap;
}
.combo-opt:hover, .combo-opt.active { background: #eef9fe; }
.combo-opt-other { border-top: 1px solid var(--border); margin-top: 2px; color: var(--primary-strong); font-weight: 600; }

/* ---------- Toggle „niciuna" ---------- */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 8px;
  cursor: pointer;
}
.toggle input { margin: 0; }

/* ---------- Consimțământ ---------- */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #eef9fe;
  border: 1px solid #cdeefb;
  border-radius: var(--radius-input);
  padding: 12px;
  font-weight: 400;
  cursor: pointer;
}
.consent input {
  margin-top: 2px;
}
.consent-text { font-size: 13.5px; color: var(--text); line-height: 1.45; }
.privacy-link-wrap { margin: 8px 2px 0; }
.privacy-link-wrap a, .btn-link {
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
}

/* ---------- Semnătură ---------- */
.signature-field { margin-top: 18px; }
.signature-hint { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.signature-canvas {
  width: 100%;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-input);
  background: var(--surface);
  display: block;
  touch-action: none;
}
.signature-field.has-error .signature-canvas { border-color: var(--error); }
.signature-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.signature-alt { font-size: 12.5px; color: var(--muted-2); margin-top: 6px; }

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  min-height: 36px;
}

/* ---------- Submit ---------- */
.submit-wrap { margin: 4px 0 8px; }
.form-error {
  display: none;
  color: var(--error);
  font-size: 14px;
  margin-bottom: 10px;
  text-align: center;
}
.form-error.show { display: block; }

.btn-primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-input);
  padding: 15px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 52px;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }

.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-primary.loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Succes ---------- */
.success { text-align: center; padding: 32px 20px; }
.success-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: #e6f9ed;
  color: #21a35a;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.success h2 { font-size: 20px; margin-bottom: 6px; }
.success p { color: var(--muted); font-size: 14.5px; margin-bottom: 16px; }

/* ---------- Focus vizibil global (accesibilitate) ---------- */
:focus-visible { outline: 2px solid var(--primary-strong); outline-offset: 2px; }

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