/* KairosCampus Forms — tema claro, minimalista, iframe-friendly */

:root {
  --bg: #f3f5f4;
  --bg-deep: #e8ecea;
  --bg-elevated: #ffffff;
  --bg-soft: #f7f9f8;
  --ink: #15201e;
  --ink-muted: #5a6b66;
  --ink-faint: #879690;
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --accent-soft: rgba(15, 118, 110, 0.08);
  --line: rgba(21, 32, 30, 0.1);
  --line-strong: rgba(21, 32, 30, 0.16);
  --success: #047857;
  --success-soft: rgba(4, 120, 87, 0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(21, 32, 30, 0.04), 0 12px 32px rgba(21, 32, 30, 0.06);
  --shadow-hover: 0 2px 4px rgba(21, 32, 30, 0.05), 0 16px 40px rgba(21, 32, 30, 0.08);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --space: clamp(1rem, 2.5vw, 1.75rem);
  --focus: 0 0 0 3px rgba(15, 118, 110, 0.28);
}

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

html {
  height: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(15, 118, 110, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms var(--ease);
}

a:hover {
  color: var(--accent-strong);
}

.page {
  position: relative;
  width: min(100% - 1.5rem, 40rem);
  margin: 0 auto;
  padding: var(--space) 0 calc(var(--space) + 0.5rem);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.brand-mark {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 1.85rem);
}

.panel-header {
  margin-bottom: 1.25rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 560;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.6rem, 4.5vw, 2.15rem);
}

h2 {
  font-size: clamp(1.3rem, 3.8vw, 1.7rem);
}

.lead {
  margin: 0.75rem 0 0;
  color: var(--ink-muted);
  font-size: 1.02rem;
}

/* Index */
.quiz-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.quiz-list a {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  color: inherit;
  text-decoration: none;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease);
}

.quiz-list a:hover,
.quiz-list a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.35);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.quiz-list a:focus-visible {
  box-shadow: var(--shadow-hover), var(--focus);
}

.quiz-list strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 560;
}

.quiz-list span {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.meta {
  margin-top: 1.35rem;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--bg-deep);
  color: var(--ink-muted);
}

/* Progress */
.progress {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 650;
}

.progress-track {
  height: 0.35rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-deep);
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 420ms var(--ease);
}

/* Quiz stages */
.stage {
  display: none;
}

.stage.is-active {
  display: block;
  animation: rise 380ms var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-text {
  margin: 0 0 1.1rem;
}

.options {
  display: grid;
  gap: 0.65rem;
}

.option {
  width: 100%;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    transform 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.option:hover,
.option:focus-visible {
  border-color: rgba(15, 118, 110, 0.4);
  background: var(--accent-soft);
  outline: none;
  transform: translateY(-1px);
}

.option:focus-visible {
  box-shadow: var(--focus);
}

.option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.25);
}

.option-title {
  display: block;
  font-weight: 650;
}

.option-desc {
  display: block;
  margin-top: 0.2rem;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.3rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 160ms var(--ease),
    opacity 160ms var(--ease),
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    box-shadow 160ms var(--ease);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:not(:disabled):hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: rgba(21, 32, 30, 0.28);
  background: var(--bg-soft);
}

/* Result */
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-summary {
  margin: 0.9rem 0 0;
  color: var(--ink-muted);
}

.result-path {
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.result-path li {
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-soft);
}

.result-path strong {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--ink);
  font-size: 0.88rem;
}

.result-path span {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.options.is-interactive {
  display: block;
}

.page-wide {
  width: min(100% - 1.5rem, 48rem);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
