/* ── Kérdőív shared styles ── */

.kerdo-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.kerdo-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem;
  margin-bottom: 1.6rem;
}

.kerdo-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--green-bg);
}

.kerdo-section-desc {
  font-size: .92rem;
  color: var(--gray);
  margin-bottom: 1.2rem;
  line-height: 1.6;
}

.kerdo-info-box {
  background: var(--green-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .8rem 1rem;
  font-size: .88rem;
  color: var(--gray);
  margin-bottom: 1.2rem;
}

/* ── Fields ── */
.field-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1rem;
}
.field-group:last-child { margin-bottom: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field-label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--dark);
}
.field-label.required::after {
  content: ' *';
  color: #c0392b;
}

.kerdo-wrap input[type="text"],
.kerdo-wrap input[type="email"],
.kerdo-wrap input[type="tel"],
.kerdo-wrap input[type="date"],
.kerdo-wrap input[type="search"],
.kerdo-wrap textarea,
.kerdo-wrap select {
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  transition: border-color .2s;
}
.kerdo-wrap input:focus,
.kerdo-wrap textarea:focus {
  outline: none;
  border-color: var(--green);
}
.kerdo-wrap textarea { resize: vertical; min-height: 100px; }

/* ── Radio / Checkbox ── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  margin-top: .3rem;
}
.radio-group-horiz {
  flex-direction: row;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .92rem;
  color: var(--dark);
  cursor: pointer;
  padding: .4rem .6rem;
  border-radius: 6px;
  transition: background .15s;
}
.radio-option:hover { background: var(--green-bg); }
.radio-option input[type="radio"] {
  accent-color: var(--green);
  width: 16px; height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  font-size: .92rem;
  color: var(--dark);
  cursor: pointer;
  padding: .5rem .6rem;
  border-radius: 6px;
  transition: background .15s;
  line-height: 1.5;
}
.checkbox-option:hover { background: var(--green-bg); }
.checkbox-option input[type="checkbox"] {
  accent-color: var(--green);
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.checkbox-option a { color: var(--green); text-decoration: underline; }

/* ── Scale legend ── */
.scale-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  margin-bottom: 1rem;
  font-size: .85rem;
  color: var(--gray);
}
.scale-val {
  background: var(--green-bg);
  padding: .25rem .8rem;
  border-radius: 50px;
  font-weight: 600;
  color: var(--green);
}

/* ── Rating table ── */
.rating-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.rating-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 340px;
}
.rating-table th {
  background: var(--green);
  color: var(--white);
  padding: .55rem .4rem;
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  white-space: normal;
  word-break: keep-all;
  min-width: 44px;
}
.rating-table th.q-col { text-align: left; width: 52%; white-space: nowrap; min-width: unset; }
.rating-table td {
  padding: .5rem .35rem;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  vertical-align: middle;
}
.rating-table td:first-child { color: var(--dark); line-height: 1.45; padding-left: .6rem; }
.rating-table td:not(:first-child) { text-align: center; }
.rating-table tr:last-child td { border-bottom: none; }
.rating-table tr:nth-child(even) td { background: #fafcfb; }
.rating-table tr:hover td { background: var(--green-bg); }

.rating-table input[type="radio"] {
  accent-color: var(--green);
  width: 17px; height: 17px;
  cursor: pointer;
}

/* Row num badge */
.row-num {
  display: inline-block;
  min-width: 22px;
  font-size: .75rem;
  font-weight: 700;
  color: var(--green);
  margin-right: .3rem;
}

/* ── Yes/No rows (SCQ) ── */
.yn-row {
  display: grid;
  grid-template-columns: 26px 1fr auto auto;
  align-items: center;
  gap: .5rem 1rem;
  padding: .65rem .5rem;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
}
.yn-row:last-child { border-bottom: none; }
.yn-row:nth-child(even) { background: #fafcfb; }
.yn-row:hover { background: var(--green-bg); }
.yn-num { font-size: .78rem; font-weight: 700; color: var(--green); text-align: right; }
.yn-text { color: var(--dark); line-height: 1.45; }
.yn-opt {
  display: flex; align-items: center; gap: .4rem;
  font-size: .88rem; cursor: pointer; white-space: nowrap;
  padding: .2rem .5rem; border-radius: 6px;
}
.yn-opt:hover { background: var(--green-bg); }
.yn-opt input[type="radio"] {
  accent-color: var(--green);
  width: 15px; height: 15px; cursor: pointer;
}

/* ── Score boxes ── */
.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: .5rem;
}
.score-box {
  background: var(--green-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem .8rem;
  text-align: center;
}
.score-box.score-total {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}
.score-label { font-size: .8rem; color: var(--gray); line-height: 1.4; margin-bottom: .4rem; }
.score-total .score-label { color: rgba(255,255,255,.8); }
.score-number { font-size: 2rem; font-weight: 800; color: var(--green); line-height: 1; }
.score-total .score-number { color: var(--white); }
.score-max { font-size: .78rem; color: var(--gray); margin-top: .1rem; }
.score-total .score-max { color: rgba(255,255,255,.7); }
.score-note { font-size: .82rem; color: var(--gray); margin-top: 1rem; font-style: italic; }

/* ── Submit row ── */
.kerdo-submit-row {
  margin-top: 2rem;
  display: flex;
  justify-content: flex-start;
}

/* ── Messages ── */
.form-message {
  margin-top: 1.2rem;
  padding: 1rem 1.4rem;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
}
.form-message.success {
  background: #e6f4ea;
  color: #2e7d32;
  border: 1px solid #a8d5b0;
}
.form-message.error {
  background: #fce8e8;
  color: #c0392b;
  border: 1px solid #f5a9a9;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .kerdo-section { padding: 1.3rem 1rem; }
  .field-row { grid-template-columns: 1fr; }
  .score-grid { grid-template-columns: 1fr 1fr; }
  .yn-row { grid-template-columns: 22px 1fr; }
  .yn-opt { grid-column: 2; }
  .radio-group-horiz { flex-direction: column; }
}
