/* Gurasoeskola · estilo orokorrak */

:root {
  --paper: #fbf8f2;
  --paper-2: #f2eadc;
  --paper-3: #e9dfcd;
  --ink: #17221f;
  --ink-soft: #53625c;
  --ink-faint: #7d8a84;
  --teal: #0e6b5c;
  --teal-dark: #094f44;
  --teal-soft: #e4f2ed;
  --terra: #b55433;
  --terra-dark: #8f3f24;
  --terra-soft: #f9e8df;
  --gold: #d9a62e;
  --gold-soft: #fbf0cf;
  --line: #ded4c3;
  --line-strong: #c9bca6;
  --white: #fffdf9;
  --ok: #2f7d5c;
  --ok-soft: #edf8f2;
  --danger: #a63f2f;
  --danger-soft: #fbeae6;
  --radius: 18px;
  --radius-lg: 26px;
  --shadow-sm: 0 2px 0 rgba(23, 34, 31, 0.04);
  --shadow: 0 22px 60px -32px rgba(23, 34, 31, 0.4);
  --shadow-soft: 0 10px 30px -22px rgba(23, 34, 31, 0.45);
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

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

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(217, 166, 46, 0.15), transparent 62%),
    radial-gradient(900px 500px at -8% 12%, rgba(14, 107, 92, 0.09), transparent 58%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

body.embed {
  background: var(--paper);
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal-dark);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

ul,
ol {
  margin-top: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.08em 0.38em;
}

::selection {
  background: var(--gold-soft);
}

:focus-visible {
  outline: 3px solid rgba(14, 107, 92, 0.35);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.narrow {
  width: min(780px, calc(100% - 40px));
  margin-inline: auto;
}

.muted {
  color: var(--ink-soft);
}

.micro {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  margin: 0 0 0.9em;
  color: var(--terra);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.preline {
  white-space: pre-line;
}

fieldset {
  min-width: 0;
}

.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.stack {
  display: grid;
  gap: 14px;
}

.inline-form {
  display: inline;
  margin: 0;
}

/* ---------- Goiburua ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 242, 0.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(222, 212, 195, 0.7);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--teal);
  color: var(--paper);
  box-shadow: 0 6px 14px -8px rgba(14, 107, 92, 0.75);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand-dot {
  color: var(--terra);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--ink);
  background: rgba(242, 234, 220, 0.8);
}

.nav-link[aria-current="page"] {
  color: var(--teal);
  background: var(--teal-soft);
}

/* ---------- Botoiak ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 46px;
  padding: 0.72em 1.25em;
  border: 1.5px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, color 120ms ease,
    box-shadow 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(14, 107, 92, 0.9);
}

.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--terra);
  border-color: var(--terra);
  color: #fff;
}

.btn-secondary:hover {
  background: var(--terra-dark);
  border-color: var(--terra-dark);
  color: #fff;
}

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

.btn-ghost:hover {
  background: var(--white);
  border-color: var(--ink-faint);
  color: var(--ink);
}

.btn-soft {
  background: var(--teal-soft);
  border-color: transparent;
  color: var(--teal-dark);
}

.btn-soft:hover {
  background: #d7ebe4;
  color: var(--teal-dark);
}

.btn-danger {
  background: var(--danger-soft);
  border-color: #e9c3ba;
  color: var(--danger);
}

.btn-danger:hover {
  background: #f6dcd5;
  color: var(--danger);
}

.btn-small {
  min-height: 38px;
  padding: 0.5em 0.85em;
  font-size: 0.86rem;
  border-radius: 10px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Heroia ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: clamp(30px, 5vw, 72px);
  align-items: center;
  padding: clamp(48px, 8vw, 104px) 0 clamp(40px, 6vw, 72px);
}

.hero h1 {
  font-size: clamp(2.7rem, 6.4vw, 4.7rem);
  letter-spacing: -0.035em;
  margin-bottom: 0.28em;
}

.hero h1 em {
  font-style: normal;
  color: var(--teal);
  position: relative;
  white-space: nowrap;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.02em;
  height: 0.16em;
  background: var(--gold-soft);
  z-index: -1;
  border-radius: 3px;
}

.lead {
  max-width: 58ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 1.4em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-card {
  position: relative;
  padding: 30px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 253, 249, 0.96), rgba(246, 238, 224, 0.9));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px dashed rgba(201, 188, 166, 0.6);
  border-radius: 19px;
  pointer-events: none;
}

.hero-card-kicker {
  margin: 0 0 12px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra);
}

.hero-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--font-serif);
  color: var(--teal);
  line-height: 1;
}

.hero-stat span {
  font-size: clamp(3.6rem, 7vw, 5.4rem);
  letter-spacing: -0.05em;
}

.hero-stat small {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0;
}

.hero-card-text {
  margin: 14px 0 18px;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.38em 0.7em;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

/* ---------- Atalak ---------- */

.section {
  padding: clamp(46px, 7vw, 82px) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  margin: 0;
}

.section-head p {
  max-width: 52ch;
  margin: 0;
  color: var(--ink-soft);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 24px 22px 22px;
  background: rgba(255, 253, 249, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 800;
  font-size: 0.9rem;
}

.step h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 0.35em;
}

.step p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.91rem;
  line-height: 1.5;
}

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

.card {
  padding: clamp(24px, 4vw, 38px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.8);
  box-shadow: var(--shadow-sm);
}

.card-accent {
  background: linear-gradient(155deg, var(--teal) 0%, #0a5a4d 100%);
  border-color: transparent;
  color: #fff;
}

.card-accent h2,
.card-accent h3 {
  color: #fff;
}

.card-accent p {
  color: rgba(255, 255, 255, 0.82);
}

.card-accent .eyebrow {
  color: var(--gold);
}

.card-accent .btn-ghost {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.card-accent .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.card h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.card p:last-child {
  margin-bottom: 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Orri orokorra ---------- */

.page {
  padding: clamp(36px, 6vw, 72px) 0 clamp(56px, 8vw, 96px);
}

.page-head {
  max-width: 760px;
  margin-bottom: 30px;
}

.page-head h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
}

.page-head p {
  color: var(--ink-soft);
  font-size: 1.03rem;
}

.success-panel,
.quiz-shell,
.q-block,
.field,
.admin-sub {
  scroll-margin-top: 96px;
}

.panel {
  padding: clamp(22px, 4vw, 34px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.86);
  box-shadow: var(--shadow-sm);
}

.error-panel {
  max-width: 620px;
  margin: 4vh auto;
  text-align: center;
}

/* ---------- Galdetegia ---------- */

.quiz-page {
  display: flex;
  justify-content: center;
  padding: clamp(18px, 4vw, 46px) 16px clamp(48px, 7vw, 80px);
}

.quiz-shell {
  width: min(820px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 234, 220, 0.38);
}

.quiz-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
}

.quiz-brand .brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.quiz-brand .brand-mark svg {
  width: 19px;
  height: 19px;
}

.quiz-top-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-body {
  padding: clamp(24px, 4.5vw, 40px);
}

.quiz-loading {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 330px;
  text-align: center;
  color: var(--ink-soft);
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--paper-3);
  border-top-color: var(--teal);
  animation: spin 0.8s linear infinite;
}

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

.start-screen {
  padding: 4px 0;
}

.start-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 0.35em 0.75em;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #7a5a0d;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.start-screen h1 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  margin-bottom: 0.35em;
}

.start-screen .lead {
  font-size: 1.02rem;
  margin-bottom: 1.3em;
}

.start-privacy {
  margin: 0 0 20px;
  padding: 12px 15px;
  border-left: 3px solid var(--teal);
  border-radius: 0 10px 10px 0;
  background: var(--teal-soft);
  color: #174f43;
  font-size: 0.88rem;
  line-height: 1.55;
}

.start-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.quiz-note {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 0.82rem;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.question-count {
  color: var(--teal);
}

.progress-track {
  height: 6px;
  margin-bottom: 26px;
  border-radius: 999px;
  background: var(--paper-2);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #2f9a85);
  transition: width 300ms ease;
}

.question-text {
  font-size: clamp(1.32rem, 2.5vw, 1.7rem);
  line-height: 1.34;
  margin-bottom: 24px;
}

.options {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 17px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color 130ms ease, background-color 130ms ease, transform 130ms ease,
    box-shadow 130ms ease, opacity 130ms ease;
}

.option:hover:not(:disabled) {
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.option:disabled {
  cursor: default;
}

.option-letter {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-weight: 800;
  font-size: 0.86rem;
  transition: background-color 130ms ease, color 130ms ease;
}

.option-text {
  flex: 1;
}

.option-mark {
  flex: 0 0 auto;
  padding: 0.2em 0.5em;
  border-radius: 999px;
  background: var(--ok);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.option.is-correct {
  border-color: #6fb597;
  background: var(--ok-soft);
}

.option.is-correct .option-letter {
  background: var(--ok);
  color: #fff;
}

.option.is-wrong {
  border-color: #d69b87;
  background: var(--terra-soft);
}

.option.is-wrong .option-letter {
  background: var(--terra);
  color: #fff;
}

.option.is-dimmed {
  opacity: 0.55;
}

.feedback {
  margin-top: 22px;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  animation: rise 220ms ease both;
}

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

.feedback.is-ok {
  background: var(--ok-soft);
  border-color: #bfe0d0;
}

.feedback.is-no {
  background: var(--terra-soft);
  border-color: #ecc7b8;
}

.feedback-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.feedback-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}

.feedback.is-ok .feedback-icon {
  background: var(--ok);
}

.feedback.is-no .feedback-icon {
  background: var(--terra);
}

.feedback-title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0;
}

.feedback-sub {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.explanation {
  margin: 15px 0 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.6;
}

.explanation strong {
  font-weight: 800;
}

.source {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(23, 34, 31, 0.16);
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.source strong {
  display: inline-block;
  margin-right: 4px;
  color: var(--ink);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.next-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

.result {
  padding: 10px 0 4px;
  text-align: center;
}

.result-kicker {
  margin: 0 0 12px;
  color: var(--terra);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(4.4rem, 13vw, 6.6rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  color: var(--teal);
}

.result-score small {
  font-family: var(--font-sans);
  font-size: 0.22em;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.result-title {
  margin: 18px 0 8px;
  font-size: clamp(1.45rem, 3vw, 1.95rem);
}

.result-text {
  max-width: 52ch;
  margin: 0 auto 8px;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.result-note {
  max-width: 52ch;
  margin: 0 auto;
  padding: 0.7em 0.9em;
  border-radius: 12px;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.quiz-empty {
  padding: 30px 0;
  text-align: center;
}

.quiz-empty h1 {
  font-size: 1.7rem;
}

.quiz-footnote {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 0.78rem;
  text-align: center;
}

/* ---------- Inprimakiak ---------- */

.access-panel {
  max-width: 760px;
  margin: 0 auto 24px;
}

.access-panel h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.access-form {
  max-width: 540px;
  margin-top: 18px;
}

.access-success {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #bfe0d0;
  border-radius: 14px;
  background: var(--ok-soft);
}

.access-success .success-icon {
  width: 44px;
  height: 44px;
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.access-success h2 {
  margin: 0;
  font-size: 1.55rem;
}

.access-success p {
  margin: 0;
  color: var(--ink-soft);
}

#bidalketa-form {
  scroll-margin-top: 96px;
}

.student-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid #c6e3d9;
  border-radius: 12px;
  background: var(--teal-soft);
}

.student-banner p {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.9rem;
}

.student-banner button {
  border: 0;
  background: none;
  color: var(--teal-dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.form-main {
  min-width: 0;
}

.form-aside {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.form-aside .panel {
  padding: 22px;
}

.form-aside h2 {
  font-size: 1.2rem;
}

.form-aside ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.form-aside li + li {
  margin-top: 8px;
}

.person-fields {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.field:last-child {
  margin-bottom: 0;
}

.field > label,
.field > .field-label {
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.field .hint {
  margin: -2px 0 0;
  color: var(--ink-faint);
  font-size: 0.78rem;
}

input[type="text"],
input[type="url"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.72em 0.85em;
  border: 1.5px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

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

input:hover,
textarea:hover,
select:hover {
  border-color: var(--ink-faint);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 107, 92, 0.14);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fff8f6;
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
}

.q-block {
  margin: 0 0 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.86);
  box-shadow: var(--shadow-sm);
}

.q-block legend {
  padding: 0 10px;
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
}

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

.option-field {
  display: grid;
  gap: 5px;
}

.option-field .opt-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink-soft);
}

.opt-badge {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.correct-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.form-status {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.form-status.is-error {
  color: var(--danger);
}

.form-status.is-ok {
  color: var(--ok);
}

.alert {
  margin: 0 0 20px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 0.9rem;
}

.alert-error {
  background: var(--danger-soft);
  border-color: #ecc4bb;
  color: #7f2d21;
}

.alert-ok {
  background: var(--ok-soft);
  border-color: #bfe0d0;
  color: #1f5c43;
}

.alert ul {
  margin: 0.5em 0 0;
  padding-left: 1.2em;
}

.success-panel {
  padding: clamp(26px, 5vw, 44px);
  border-radius: var(--radius-lg);
  border: 1px solid #bfe0d0;
  background: linear-gradient(160deg, var(--ok-soft), #f8fdf9);
  text-align: center;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
}

.success-panel h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
}

.success-panel p {
  max-width: 52ch;
  margin-inline: auto;
  color: var(--ink-soft);
}

.draft-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: #6d520f;
  font-size: 0.84rem;
}

.draft-info button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.draft-status {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.78rem;
}

/* ---------- Kodea sortzeko orria ---------- */

.site-embed-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(22px, 4vw, 42px);
  align-items: start;
}

.site-embed h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.site-url-label {
  display: block;
  margin: 18px 0 6px;
  font-size: 0.86rem;
  font-weight: 800;
}

.site-url-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.site-url-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--paper-2);
  color: var(--ink-soft);
}

.site-url-row .btn {
  flex: 0 0 auto;
}

.site-embed-preview .preview-frame {
  height: 700px;
}

.code-details {
  margin-top: 22px;
  padding: 0;
  overflow: hidden;
}

.code-details > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 26px;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.code-details > summary::-webkit-details-marker {
  display: none;
}

.code-details > summary span {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  white-space: nowrap;
}

.code-details > summary small {
  flex: 1;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.code-details > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-soft);
  font-size: 1.1rem;
  font-weight: 700;
}

.code-details[open] > summary::after {
  content: "−";
}

.code-details-body {
  padding: 0 26px 26px;
  border-top: 1px solid var(--line);
}

.code-details-body .code-field:first-child {
  margin-top: 22px;
}

.code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.code-panel h2 {
  font-size: 1.3rem;
}

.code-field {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.code-field label {
  font-size: 0.86rem;
  font-weight: 800;
}

.code-area {
  width: 100%;
  min-height: 240px;
  padding: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: #1d2a26;
  color: #e9f1ed;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  resize: vertical;
  white-space: pre;
  overflow: auto;
}

.code-area:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(14, 107, 92, 0.18);
}

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

.preview-frame {
  display: block;
  width: 100%;
  height: 700px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
}

.steps-wix {
  margin-top: 24px;
}

.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: wix;
}

.step-list li {
  position: relative;
  padding-left: 46px;
  margin-bottom: 14px;
  color: var(--ink-soft);
}

.step-list li::before {
  counter-increment: wix;
  content: counter(wix);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
}

.note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  background: var(--gold-soft);
  color: #64500f;
  font-size: 0.88rem;
}

.note strong {
  color: #4d3c08;
}

.note.is-error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: #7f2d21;
}

/* ---------- Oina ---------- */

.site-footer {
  margin-top: clamp(40px, 7vw, 80px);
  border-top: 1px solid var(--line);
  background: rgba(242, 234, 220, 0.35);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 26px 0;
}

.footer-inner p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.footer-inner a {
  color: var(--ink-soft);
}

/* ---------- Embed ---------- */

html.embed .site-header,
html.embed .site-footer {
  display: none;
}

html.embed body {
  background: var(--paper);
}

html.embed .quiz-page {
  padding: 12px;
  min-height: 100vh;
  align-items: flex-start;
}

html.embed .quiz-shell {
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

html.embed .quiz-body {
  padding: 24px;
}

html.embed .quiz-top {
  padding: 12px 24px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 52px;
  }

  .hero-card {
    max-width: 520px;
  }

  .step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-layout,
  .code-layout,
  .site-embed-grid {
    grid-template-columns: 1fr;
  }

  .form-aside {
    position: static;
    order: 2;
  }

  .form-main {
    order: 1;
  }

  .preview-frame,
  .site-embed-preview .preview-frame {
    height: 640px;
  }
}

@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    gap: 2px 12px;
    min-height: 0;
    padding: 9px 0 6px;
  }

  .site-nav {
    width: 100%;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.84rem;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 16px;
  }

  .wrap {
    width: min(100% - 28px, 1120px);
  }

  .header-inner {
    min-height: 64px;
    gap: 12px;
  }

  .brand {
    font-size: 1.08rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .site-nav {
    gap: 2px;
  }

  .nav-link {
    padding: 0 8px;
    font-size: 0.84rem;
  }

  .step-grid,
  .split,
  .options-grid,
  .person-fields,
  .correct-row {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2.35rem, 12vw, 3.4rem);
  }

  .hero-actions .btn {
    width: 100%;
  }

  .quiz-page {
    padding: 14px 12px 40px;
  }

  .quiz-top-label {
    display: none;
  }

  .quiz-shell {
    border-radius: 18px;
  }

  .quiz-top {
    padding: 12px 18px;
  }

  .quiz-body {
    padding: 22px 18px 26px;
  }

  .option {
    padding: 13px 14px;
    gap: 11px;
    font-size: 0.94rem;
  }

  .option-letter {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .feedback {
    padding: 17px 15px;
  }

  .next-row .btn {
    width: 100%;
  }

  .q-block {
    padding: 18px;
  }

  .form-actions .btn {
    width: 100%;
  }

  .site-url-row {
    flex-direction: column;
  }

  .site-url-row .btn {
    width: 100%;
  }

  .code-details > summary {
    flex-wrap: wrap;
    padding: 18px;
  }

  .code-details > summary small {
    order: 3;
    width: 100%;
    flex-basis: 100%;
  }

  .code-details-body {
    padding: 0 18px 18px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .site-nav .nav-link:first-child {
    display: none;
  }
}

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