/* =====================================================================
   SURVEY STYLES — Manager AI Assessment
   Responsive: 3-col (>=1200px), 2-col (>=720px), 1-col (<720px)
   ===================================================================== */

/* --- Variables & Reset --- */
:root {
  --navy:       #0d1b2a;
  --navy-mid:   #1c3251;
  --accent:     #1b4fce;
  --accent-hover: #1440b0;
  --bg:         #edf1f7;
  --card:       #ffffff;
  --border:     #cdd5e0;
  --text:       #1a2535;
  --text-mid:   #445068;
  --text-muted: #7a8ba0;
  --required:   #d63031;
  --success-bg: #e8f8f2;
  --success-fg: #076343;
  --error-bg:   #fdecea;
  --error-fg:   #a51b0b;

  --font-head:  'Libre Baskerville', Georgia, serif;
  --font-body:  'Source Sans 3', system-ui, sans-serif;

  --radius-sm:  4px;
  --radius:     8px;
  --pad-card:   14px;
  --gap:        14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
.survey-header {
  background: var(--navy);
  padding: 18px 20px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
}

.header-badge {
  display: inline-block;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

#survey-title {
  font-family: var(--font-head);
  font-size: clamp(15px, 2.2vw, 20px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
  line-height: 1.2;
}

#survey-subtitle {
  font-size: 11px;
  color: #94afc7;
  margin-top: 4px;
  line-height: 1.4;
}

/* --- Main body --- */
.survey-body {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px;
}

/* --- 3-column grid --- */
.columns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  align-items: start;
}

.column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* --- Section cards --- */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad-card);
  border-top: 3px solid var(--accent);
}

.section-title {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: -.1px;
}

.section-desc {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 10px;
  line-height: 1.35;
}

/* --- Form groups --- */
.form-group {
  margin-bottom: 9px;
}

.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.3;
}

.form-label.required::after {
  content: ' *';
  color: var(--required);
}

/* --- Rating 1-5 --- */
.rating-scale {
  display: flex;
  gap: 3px;
}

.rating-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.rating-option input[type="radio"] {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  display: block;
  margin: 0;
}

.rating-option label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: block;
  margin: 0;
  text-align: center;
  line-height: 1;
}

.rating-endpoints {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

/* --- Radio group --- */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 1px 0;
}

.radio-item input[type="radio"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.radio-item span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.3;
  cursor: pointer;
}

/* --- Checkbox group --- */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 3px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.checkbox-item span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mid);
  line-height: 1.3;
  cursor: pointer;
}

/* --- Native inputs --- */
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text);
  background: #fbfcfe;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(27,79,206,.15);
  background: #fff;
}

select {
  height: 29px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a8ba0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

input[type="number"] { height: 29px; }

textarea {
  resize: vertical;
  min-height: 46px;
  line-height: 1.45;
}

/* --- Two-column pair inside a section --- */
.input-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 9px;
}

.input-pair .form-group { margin-bottom: 0; }

/* --- Form footer --- */
.form-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 8px;
}

.btn-submit {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 40px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .2px;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(27,79,206,.3);
}

.btn-submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(27,79,206,.35);
}

.btn-submit:active { transform: scale(.98); }

/* --- Status messages --- */
.loading-msg {
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-msg.visible { display: flex; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

.message {
  display: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.message.visible { display: block; }
.message.success { background: var(--success-bg); color: var(--success-fg); }
.message.error   { background: var(--error-bg);   color: var(--error-fg);   }

/* --- Subsection divider --- */
.subsection-divider {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 10px 0 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* 2-column tablet */
@media (max-width: 1199px) and (min-width: 720px) {
  .columns-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Third column spans full width on second row */
  .column:nth-child(3) {
    grid-column: 1 / -1;
  }

  /* In that case, demographics can go 2-col internally on wider tablet */
  .column:nth-child(3) .section-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
  }

  .column:nth-child(3) .section-title,
  .column:nth-child(3) .section-desc {
    grid-column: 1 / -1;
  }
}

/* 1-column mobile */
@media (max-width: 719px) {
  .survey-header { padding: 14px 14px 12px; position: static; }

  #survey-title { font-size: 16px; }
  #survey-subtitle { font-size: 11px; }

  .survey-body { padding: 12px; }

  .columns-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .input-pair { grid-template-columns: 1fr; }

  .rating-scale { gap: 2px; }

  .section-card { padding: 12px; }
}

/* Large screen: slightly tighter padding */
@media (min-width: 1400px) {
  #survey-title { font-size: 21px; }
  .survey-body { padding: 18px 20px; }
}

/* Print */
@media print {
  .survey-header { position: static; box-shadow: none; }
  .btn-submit, .loading-msg, .message { display: none !important; }
  .columns-grid { grid-template-columns: repeat(3, 1fr); }
  .section-card { border: 1px solid #ccc; border-top: 2px solid #333; break-inside: avoid; }
}