/* Raparti Manasa brand tokens (Brand Manual V2) */
:root {
  --mist: #C1DBE4;
  --paper: #EFEFEF;
  --ink: #1C1C1C;

  /* Tints of the brand palette, used for borders and quiet text only */
  --ink-70: rgba(28, 28, 28, 0.72);
  --ink-20: rgba(28, 28, 28, 0.2);
  --ink-08: rgba(28, 28, 28, 0.08);
  --mist-deep: #A9CAD6;

  --font-heading: 'Poppins', system-ui, sans-serif;
  --font-body: 'Work Sans', system-ui, sans-serif;

  --radius: 14px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

/* ---------- Layout ---------- */

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 38%) 1fr;
}

.panel {
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(32px, 5vw, 64px);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}

.panel__logo { width: min(100%, 300px); }

/* Pinned to the bottom so the logo stays centred in the panel */
.progress {
  position: absolute;
  left: clamp(32px, 5vw, 64px);
  right: clamp(32px, 5vw, 64px);
  bottom: clamp(32px, 5vw, 64px);
}
.panel__mark { display: none; }

.stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 7vw, 112px);
  outline: none;
}

.screen { width: 100%; max-width: 620px; }

/* ---------- Progress ---------- */

.progress__label {
  margin: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.progress__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.progress__steps li {
  height: 6px;
  border-radius: 3px;
  background: rgba(239, 239, 239, 0.18);
  transition: background-color 240ms var(--ease);
}

.progress__steps li.is-done { background: var(--mist); }
.progress__steps li.is-current { background: var(--paper); }

/* ---------- Screens ---------- */

.screen--enter { animation: enter 360ms var(--ease) both; }

@keyframes enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.screen__title {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  text-wrap: balance;
}

.screen__title--display {
  font-weight: 600;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.screen__text {
  font-size: 1.125rem;
  color: var(--ink-70);
  margin: 0 0 32px;
  max-width: 34em;
}

.screen__hint {
  font-size: 0.9375rem;
  color: var(--ink-70);
  margin: -16px 0 24px;
}

/* ---------- Options ---------- */

.options {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.option {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 14px 18px;
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 500 1.0625rem/1.3 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}


.option[aria-checked="true"] {
  background: var(--mist);
  border-color: var(--ink);
}

.option__key {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid var(--ink-20);
  font: 600 0.8125rem/1 var(--font-heading);
}

.option[aria-checked="true"] .option__key {
  background: var(--ink);
  border-color: var(--ink);
}

/* Selected shows as a plain black badge */
.option[aria-checked="true"] .option__key span { visibility: hidden; }

/* Rating scale */
.rating {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.rating .option {
  justify-content: center;
  min-height: 72px;
  padding: 0;
  font: 500 1.375rem/1 var(--font-heading);
}

.rating__labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  font-size: 0.9375rem;
  color: var(--ink-70);
}

/* ---------- Email ---------- */

.field__label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem);
  line-height: 1.28;
  margin-bottom: 8px;
}

.field__label + .screen__hint { margin: 0 0 24px; }

.field__input {
  width: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--ink-20);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 400 1.125rem/1.3 var(--font-body);
  transition: border-color 160ms var(--ease);
}

.field__input:focus { border-color: var(--ink); }
.field__input[aria-invalid="true"] { border-color: var(--ink); background: var(--mist); }

/* ---------- Messages ---------- */

.message {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 500;
}

.message:empty { display: none; }

.message--error {
  background: var(--ink);
  color: var(--paper);
}

.message--info {
  background: var(--mist);
  color: var(--ink);
}

/* ---------- Actions ---------- */

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: 500 1rem/1 var(--font-heading);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease);
}

.button[disabled] { cursor: progress; opacity: 0.7; }

.button--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink-20);
}


.keyhint {
  font-size: 0.875rem;
  color: var(--ink-70);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

/* ---------- Hover (mouse only: phones would keep the hover look after a tap) ---------- */

@media (hover: hover) {
  .option:hover { border-color: var(--ink); }
  .field__input:hover { border-color: var(--ink-70); }
  .button:hover { background: var(--paper); color: var(--ink); }
  .button[disabled]:hover { background: var(--ink); color: var(--paper); }
  .button--quiet:hover { background: transparent; border-color: var(--ink); }
}

/* ---------- Focus ---------- */

:focus-visible {
  outline: 2.5px solid var(--ink);
  outline-offset: 3px;
}

.field__input:focus-visible { outline-offset: 2px; }

/* Headings receive focus programmatically on each step for screen readers */
[tabindex="-1"]:focus { outline: none; }

/* ---------- Mobile ---------- */

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel {
    position: sticky;
    z-index: 1;
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
  }

  .panel__logo { display: none; }
  .panel__mark { display: block; width: 32px; flex: none; }

  .progress { position: static; flex: 1; }
  .progress__label { margin-bottom: 8px; font-size: 0.875rem; }

  .stage {
    justify-content: flex-start;
    padding: 32px 16px 48px;
  }

  .rating { gap: 6px; }
  .rating .option { min-height: 60px; }

  .keyhint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
