/* novolto multilingual customer survey */
/* Languages used:
   HTML = structure
   CSS = visual styling
   JavaScript = language switcher + Supabase submission
*/

:root {
  --brand-yellow: #ffff00;
  --accent-green: #5ee6a0;
  --background: #f4f4f1;
  --surface: #ffffff;
  --surface-soft: #f7f7f5;
  --border: #deded8;
  --text: #202020;
  --text-muted: #757575;
  --radius: 18px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .06);
  --max-width: 920px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--text);
  line-height: 1.45;
}

header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  border-radius: 6px;
}

.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 22px;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switcher button,
button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.language-switcher button {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: none;
}

.language-switcher button.active,
.language-switcher button:hover {
  background: var(--brand-yellow);
  color: #111;
  border-color: var(--brand-yellow);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 18px 64px;
}

.intro,
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro {
  padding: 28px;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
}

form {
  display: grid;
  gap: 14px;
}

.section-title {
  margin: 32px 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .16em;
}

.question-card {
  padding: 22px;
}

.question-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.hint,
.small {
  color: var(--text-muted);
}

.hint {
  font-size: 14px;
  margin: 0 0 14px;
}

.small {
  font-size: 12px;
  margin-top: 10px;
}

.options,
.rank-table,
.agree-grid {
  display: grid;
  gap: 9px;
}

label.option,
.rank-row,
.rating-cell {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 14px;
  padding: 12px 13px;
  cursor: pointer;
}

label.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

input[type="radio"],
input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent-green);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.rating-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.rating-cell {
  text-align: center;
  padding: 10px 6px;
}

.rating-cell input {
  display: block;
  margin: 0 auto 4px;
}

textarea,
input[type="text"],
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px 13px;
  font: inherit;
  color: var(--text);
}

textarea {
  resize: vertical;
  min-height: 96px;
}

.design-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.design-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
  overflow: hidden;
}

.design-image {
  aspect-ratio: 3 / 4;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.design-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.design-meta {
  padding: 12px;
}

.design-meta strong {
  display: block;
  margin-bottom: 3px;
}

.rank-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  align-items: center;
  gap: 12px;
}

.agree-row {
  display: grid;
  grid-template-columns: 1fr 130px 150px;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.agree-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.submit-row {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary {
  background: var(--brand-yellow);
  color: #111;
}

.secondary {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.range-scale {
  display: flex;
  justify-content: space-between;
  padding: 0 7px;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
}

/* Interactive option states */

label.option:hover,
.rating-cell:hover,
.rank-row:hover {
  border-color: #bfc0ba;
  background: #fbfbf9;
}

label.option:has(input:checked),
.rating-cell:has(input:checked) {
  border-color: #9bd8b8;
  background: #f1fff7;
  box-shadow: 0 0 0 2px rgba(94, 230, 160, .14);
}

select:focus,
textarea:focus,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

/* Other-answer text areas */

.other-input {
  margin-top: 10px;
  min-height: 78px;
}

.other-input[hidden] {
  display: none;
}

/* Q5 reopen button and saved-answer message */

.compact-button {
  padding: 10px 16px;
}

.saved-answer {
  margin: 10px 0 0;
  color: #268257;
  font-weight: 700;
  font-size: 13px;
}

/* Q5 popup modal */

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .52);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: relative;
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
  animation: modalIn .18s ease-out;
}

.modal-content h2 {
  margin: 0 0 8px;
}

.modal-textarea {
  min-height: 140px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

body.modal-open {
  overflow: hidden;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* Q15 NPS slider */

.nps-value-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 8px;
}

#npsValue {
  min-width: 44px;
  text-align: center;
  border-radius: 999px;
  padding: 5px 12px;
  background: #ffd84a;
  font-weight: 800;
  color: #111;
}

.nps-slider {
  --nps-color: #ffd84a;
  --nps-progress: 70%;

  width: 100%;
  height: 8px;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(
      to right,
      var(--nps-color) 0,
      var(--nps-color) var(--nps-progress),
      #d8d8d3 var(--nps-progress),
      #d8d8d3 100%
    );
  outline: none;
}

.nps-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--nps-color);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .28);
  cursor: pointer;
}

.nps-slider::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--nps-color);
  border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .28);
  cursor: pointer;
}

/* Tablet and phone layout */

@media (max-width: 760px) {
  header {
    align-items: flex-start;
  }

  .header-actions {
    align-items: flex-end;
    flex-direction: column;
  }

  .grid-2,
  .design-grid,
  .agree-row,
  .rank-row {
    grid-template-columns: 1fr;
  }

  .rating-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 480px) {
  header {
    padding: 14px 16px;
  }

  main {
    padding: 24px 12px 48px;
  }

  .intro,
  .question-card {
    border-radius: 15px;
  }

  .intro {
    padding: 22px;
  }

  .question-card {
    padding: 18px 14px;
  }

  .rating-grid {
    gap: 5px;
  }

  .rating-cell {
    padding: 9px 3px;
  }

  .modal-buttons {
    flex-direction: column-reverse;
  }

  .modal-buttons button {
    width: 100%;
  }
}