/* Brand color tokens (edit these to match Vertica brand precisely) */
:root {
  --brand-primary: #08AAAE;     /* main turquoise */
  --brand-primary-2: #55C2C6;   /* lighter turquoise for gradients/hover */
  --brand-ink: #2D353E;         /* deep text */
  --brand-bg: #F3FAFB;          /* subtle page background tint */
  --brand-header-bg: #E7F7F8;   /* header/footer light tint */
  --brand-border: #D3E1E5;      /* soft borders */
  --shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Prevent layout overflow from wide inputs / long text */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Base layout & typography */
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: var(--brand-bg);
  color: var(--brand-ink);
}

.container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden; /* keeps rounded corners clean */
}

/* Keep questions and controls inside the white card */
.question,
.section,
.card-item,
.scale-simple {
  width: 100%;
  max-width: 100%;
}

/* Range + tick labels should never exceed container width */
.scale-labels-simple input[type="range"],
#scaleSlider,
.scale-numbers-simple {
  max-width: 100%;
}

/* Long sentences: wrap instead of forcing horizontal overflow */
.checkbox-option,
.radio-option,
label {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Support both <header>/<footer> tags and .header/.footer classes */
header, footer,
.header, .footer {
  text-align: center;
  padding: 20px;
  background: var(--brand-header-bg);
  border-radius: 5px;
  margin-bottom: 20px;
}

h1, h2 {
  color: var(--brand-primary);
}

.section {
  margin-bottom: 30px;
  padding: 20px;
  border: 1px solid var(--brand-border);
  border-radius: 5px;
}

.question {
  margin-bottom: 20px;
  padding: 10px;
  border-left: 4px solid var(--brand-primary);
}

label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}

/* Inputs */
input[type="text"],
input[type="number"],
input[type="tel"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  box-sizing: border-box;
}

select {
  background: white;
  cursor: pointer;
}

/* Consistent focus style */
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(8, 170, 174, 0.18);
}

/* Legacy scale container (kept for backward compatibility if any .scale exists) */
.scale {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scale input[type="range"] {
  flex: 1;
  margin: 0 10px;
}

/* =========================
   Radio/Checkbox mobile wrap fix
   =========================
   Goal: when text wraps, wrapped lines align with the text column,
   not under the radio/checkbox control.
*/
.radio-option,
.checkbox-option {
  display: flex;
  gap: 12px;
  align-items: flex-start; /* align control to the first line */
}

/* Ensure the control column stays fixed-width */
.radio-option .checkmark,
.checkbox-option .checkmark {
  flex: 0 0 20px; /* fixed width = control size */
  margin-top: 2px;
}

/* Text column: wraps under itself */
.radio-option span:last-child,
.checkbox-option span:last-child {
  flex: 1;
  min-width: 0;        /* critical for wrapping inside flex */
  display: block;
  line-height: 1.4;
}

/* Small checkbox polish (custom UI) */
.checkbox-option .checkmark {
  border-color: #cbd5e1;
  background: #fff;
}

.checkbox-option:hover .checkmark {
  border-color: #9aa4b2;
}

.checkbox-option input:checked + .checkmark {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  box-shadow: 0 2px 6px rgba(8, 170, 174, 0.22);
}

/* Submit / primary buttons */
button[type="submit"],
.submit-btn {
  background: linear-gradient(135deg, #16a34a, #22c55e); /* strong green */
  color: white;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  padding: 16px;
  font-size: 17px;
}

button[type="submit"]:hover,
.submit-btn:hover {
  filter: brightness(0.95);
}

footer a,
.footer a {
  color: var(--brand-primary);
  text-decoration: none;
}

footer a:hover,
.footer a:hover {
  text-decoration: underline;
}

/* ===== Patch: scale-simple (labels above ends + numbers aligned to full width) ===== */
.scale-simple {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 15px 0;
  position: relative;
  width: 100%;
}

.scale-labels-simple {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0;
  gap: 6px;
}

.scale-labels-simple .label-text {
  font-size: 14px;
  color: var(--brand-ink);
  font-weight: 500;
  white-space: nowrap;
}

.scale-ends-simple {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 6px;
}

.scale-labels-simple input[type="range"],
#scaleSlider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e9ecef;
  accent-color: var(--brand-primary);
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: block;
}

.scale-labels-simple input[type="range"]::-webkit-slider-thumb,
#scaleSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--brand-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(8, 170, 174, 0.25);
}

.scale-labels-simple input[type="range"]::-moz-range-thumb,
#scaleSlider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--brand-primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(8, 170, 174, 0.25);
}

.scale-numbers-simple {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  font-size: 12px;
  color: #666;
  font-weight: 600;
  margin-top: 6px;
  line-height: 1;
  position: static;
}

.scale-numbers-simple span {
  text-align: center;
  min-width: 0;
}

.scale-numbers-simple span:first-child { text-align: left; }
.scale-numbers-simple span:last-child  { text-align: right; }

.scale-value-container {
  text-align: center;
  margin-top: 10px;
}

.scale-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand-primary);
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  transition: color 0.3s ease;
}

/* One-question-per-step */
.question.is-hidden {
  display: none;
}

/* Navigation buttons spacing */
.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
  margin-bottom: 22px;
}

.nav-buttons button {
  width: 100%;
  padding: 16px;
  border-radius: 10px;
}

.nav-buttons button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Make Previous look secondary (optional but recommended) */
#prevBtn {
  background: #e5e7eb !important;
  color: #333 !important;
}

#prevBtn:hover {
  background: #d1d5db !important;
}

/* Ensure stacked buttons never stick together */
#submitBtn {
  margin-top: 12px;
}

/* Inline validation messages */
.field-error {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: #b42318;
}

.field-error-box {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.35);
  background: rgba(180, 35, 24, 0.06);
  border-radius: 8px;
}

.is-invalid {
  border-color: #b42318 !important;
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.15) !important;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 10px;
  }

  .scale {
    flex-direction: column;
    align-items: stretch;
  }

  .scale input[type="range"] {
    margin: 10px 0;
  }

  .scale-numbers-simple {
    font-size: 11px;
    margin-top: 6px;
  }
}

@media (min-width: 700px) {
  .nav-buttons {
    flex-direction: row;
  }

  #submitBtn {
    margin-top: 0;
  }
}
/* Mobile: make section cards more compact */
@media (max-width: 600px) {

  .section.card {
    padding: 12px;               /* פחות גובה */
    margin-bottom: 16px;         /* פחות רווח בין כרטיסים */
    border-radius: 10px;
    background: rgba(255,255,255,0.92); /* מעט שקיפות */
    box-shadow: 0 2px 6px rgba(0,0,0,0.06); /* צל עדין */
  }

  .section.card h2 {
    font-size: 18px;             /* כותרת קטנה יותר */
    margin-bottom: 10px;         /* פחות רווח */
    line-height: 1.3;
  }

  .card-item {
    padding: 12px;               /* שאלה פחות גבוהה */
  }

  label {
    font-size: 15px;             /* טקסט שאלה קטן יותר */
    margin-bottom: 8px;
  }
}
/* Intro text – cleaner, easier reading */
.intro-text {
  max-width: 650px;              /* prevents very wide paragraphs */
  margin: 20px auto 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.7;              /* comfortable reading */
  color: rgba(45, 53, 62, 0.88); /* softer than pure black */
}

/* Paragraph spacing */
.intro-text p {
  margin: 12px 0;
}

/* Highlight contact line */
.intro-text strong {
  color: var(--brand-primary);
  font-weight: 700;
}

/* Contact row looks like a footer note */
.intro-text p:last-child {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(8, 170, 174, 0.25);
  font-size: 15px;
  color: var(--brand-ink);
}
@media (max-width: 600px) {
  .intro-text {
    font-size: 15px;
    line-height: 1.6;
    padding: 0 10px;
  }

  .intro-text p {
    margin: 10px 0;
  }
}
/* ============================
   Header Typography Upgrade
   Vertica-style clean medical look
   ============================ */

.header {
  text-align: center;
  padding: 42px 25px;
  background: var(--brand-header-bg);
  border-radius: 14px;
  margin-bottom: 25px;
}

/* Logo: cleaner spacing */
.header img {
  display: block;
  margin: 0 auto 18px;
  max-width: 140px;
  height: auto;
  opacity: 0.95;
}

/* Main title: modern, elegant, not too bold */
.header h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: 38px;
  font-weight: 600;        /* not too heavy */
  letter-spacing: -0.5px;
  margin: 0 0 18px;
  color: var(--brand-primary);
  line-height: 1.15;
}

/* Intro paragraph: readable, centered block */
.intro-text {
  max-width: 680px;
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.75;
  font-weight: 400;
  color: rgba(45, 53, 62, 0.88);
}

.intro-text p {
  margin: 14px 0;
}

/* Contact line: subtle separator */
.intro-text p:last-child {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(8, 170, 174, 0.25);
  font-size: 15px;
  color: var(--brand-ink);
}

/* Highlight Email/Phone labels */
.intro-text strong {
  color: var(--brand-primary);
  font-weight: 700;
}

/* ============================
   Mobile optimization
   ============================ */
@media (max-width: 600px) {

  .header {
    padding: 30px 18px;
  }

  .header img {
    max-width: 110px;
    margin-bottom: 14px;
  }

  .header h1 {
    font-size: 26px;       /* much better for mobile */
    margin-bottom: 14px;
  }

  .intro-text {
    font-size: 15px;
    line-height: 1.6;
    padding: 0 8px;
  }

  .intro-text p:last-child {
    font-size: 14px;
  }
}
.header-subtitle {
  font-size: 15px;
  color: rgba(45,53,62,0.7);
  margin-top: -8px;
  margin-bottom: 22px;
}
/* Special layout for "Other + free text" checkbox */
.checkbox-other {
  flex-direction: column;   /* stack vertically */
  align-items: stretch;
}

/* First row stays inline */
.checkbox-other .option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

/* Free text field appears below */
.other-text-field {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--brand-border);
  border-radius: 8px;
  font-size: 14px;
}
.other-text-field {
  display: none;
}

.other-text-field.show {
  display: block;
}
body[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

body[dir="rtl"] .radio-option,
body[dir="rtl"] .checkbox-option {
  flex-direction: row-reverse;
}

body[dir="rtl"] .checkmark {
  margin-left: 12px;
  margin-right: 0;
}
body[dir="rtl"] .field-error,
body[dir="rtl"] .field-error-box {
  text-align: right;
}
