:root {
  --paper: #fcf7ed;
  --ink: #0b352d;
  --muted: #3c574d;
  --orange: #dc4c13;
  --line: #c9cec0;
  --progress-sidebar-width: 340px;
  --progress-sidebar-gap: 70px;
  --progress-sidebar-padding: 40px;
  --serif: "Libre Caslon Display", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--orange); outline-offset: 6px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 10; top: 12px; left: 12px; padding: 12px 18px; background: var(--ink); color: var(--paper); transform: translateY(-180%); opacity: 0; }
.skip-link:focus { transform: none; opacity: 1; }
/* Shared outer width for every page; reading columns have their own limits. */
.page-shell { width: min(100% - 112px, 1420px); margin-inline: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 104px; gap: 28px; }
.wordmark { font-family: var(--serif); font-size: 64px; line-height: 1; letter-spacing: -2px; text-decoration: none; padding-bottom: 9px; }
.main-navigation { display: flex; gap: 44px; align-items: center; }
.main-navigation button, .main-navigation a { border: 0; padding: 10px 0; background: none; font-size: 18px; font-weight: 500; position: relative; text-decoration: none; }
.main-navigation button:hover, .main-navigation a:hover { color: var(--orange); }
.main-navigation .sign-in-link { border-bottom: 1px solid var(--orange); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 16px 32px; border-top: 1px solid var(--line); padding-block: 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.site-footer p { margin: 0; }
.menu-toggle { display: none; border: 0; padding: 10px; background: none; }
.hero { display: grid; grid-template-columns: 44% 56%; position: relative; min-height: 750px; align-items: start; }
.hero-copy { padding-top: 69px; position: relative; z-index: 1; }
.eyebrow { margin: 0 0 22px; font-size: 24px; font-weight: 600; color: var(--orange); letter-spacing: -.5px; }
h1 { font-family: var(--serif); font-size: clamp(94px, 9.6vw, 148px); font-weight: 400; letter-spacing: -4px; line-height: .79; margin: 0; }
h1 span { display: block; white-space: nowrap; }
.hero-description { font-size: 24px; line-height: 1.34; letter-spacing: -.35px; margin: 38px 0 23px; }
.button-primary { display: inline-flex; justify-content: center; align-items: center; gap: 20px; border: 1px solid var(--ink); border-radius: 8px; padding: 19px 30px; min-height: 62px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 18px; transition: background 160ms, transform 160ms; }
.button-primary:hover { background: #194c3d; }
.button-primary:active { transform: translateY(1px); }
.button-primary:disabled { opacity: .45; }
.progress-summary { min-width: 0; }
.progress-summary__title { margin: 0 0 7px; font: 400 30px/1.15 var(--serif); }
.progress-summary__status { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.progress-summary__metrics { display: grid; margin: 0; }
.progress-metric { min-width: 0; padding: 17px 0 18px; border-top: 1px solid var(--line); }
.progress-metric:last-child { border-bottom: 1px solid var(--line); }
.progress-metric dt { font-size: 14px; font-weight: 500; line-height: 1.45; }
.progress-metric dt a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; }
.progress-metric dt a:hover { text-decoration: underline; text-underline-offset: 4px; }
.progress-metric dd { margin: 9px 0 0; }
.progress-metric__value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.progress-metric__value strong { font: 400 38px/1.05 var(--serif); }
.progress-metric__value span { color: var(--muted); font-size: 14px; }
.progress-bar { display: block; appearance: none; width: 100%; height: 5px; margin: 13px 0 0; padding: 0; border: 0; border-radius: 5px; overflow: hidden; background: var(--line); }
.progress-bar::-webkit-progress-bar { background: var(--line); }
.progress-bar::-webkit-progress-value { background: var(--ink); border-radius: 5px; }
.progress-bar::-moz-progress-bar { background: var(--ink); border-radius: 5px; }
.progress-metric__note { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.progress-metric__dot { flex: 0 0 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }
.progress-summary__action { width: 100%; min-height: 52px; margin-top: 18px; padding: 13px 18px; font-size: 16px; text-align: center; text-decoration: none; }
.progress-summary__action img { flex: none; filter: brightness(0) invert(1); }
.progress-compact { margin: 11px 0 22px; }
.progress-compact__label { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.progress-compact .progress-bar { margin-top: 9px; }
.hero-cta { min-width: 328px; min-height: 68px; font-size: 23px; padding-inline: 31px; }
.hero-cta img { flex: none; }
.curriculum-note { margin: 29px 0 0; font-size: 17px; line-height: 1.5; color: var(--muted); white-space: nowrap; }
.level-confirmation { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.hero-art { position: relative; margin: 14px -10px 0 0; align-self: start; }
.hero-art img {
  width: 100%;
  max-width: 736px;
  height: auto;
  margin-inline: auto;
  /* Keep the element and bitmap the same size so the mask reaches the artwork. */
  /* Blend only the paper and shadow at the asset edges into the page. */
  -webkit-mask-image:
    linear-gradient(to right, transparent, #000 4.5%, #000 98%, transparent),
    linear-gradient(to bottom, transparent, #000 1.2%, #000 92%, transparent);
  mask-image:
    linear-gradient(to right, transparent, #000 4.5%, #000 98%, transparent),
    linear-gradient(to bottom, transparent, #000 1.2%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}
.stages { border-top: 1px solid var(--line); padding-top: 26px; padding-bottom: 25px; }
.stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 17px; }
.stage-choice { border: 0; padding: 0 12px; background: none; text-align: center; position: relative; display: flex; align-items: center; flex-direction: column; }
.stage-choice + .stage-choice { border-left: 1px solid var(--line); }
.stage-symbol { width: 42px; height: 36px; object-fit: contain; margin: 0 0 10px; transition: transform 180ms; }
.stage-name { font-family: var(--serif); font-size: 66px; line-height: .98; letter-spacing: -1.4px; }
.stage-description { font-size: 16px; line-height: 1.5; margin-top: 3px; }
.stage-underline { width: 70px; border-bottom: 1px solid var(--stage-accent); margin-top: 17px; transition: width 180ms; }
.stage-infantil { --stage-accent: #edac28; }
.stage-primaria { --stage-accent: #ed591d; }
.stage-eso { --stage-accent: #35604d; }
.stage-batxillerat { --stage-accent: #e78866; }
.stage-choice:hover .stage-symbol { transform: translateY(-4px); }
.stage-choice:hover .stage-underline { width: 95px; }

.site-dialog { width: min(620px, calc(100% - 40px)); max-height: calc(100dvh - 48px); border: 1px solid #d6d9cb; border-radius: 14px; background: var(--paper); color: var(--ink); padding: 48px; overflow-y: auto; }
.site-dialog::backdrop { background: rgb(8 34 27 / .38); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 17px; right: 17px; border: 0; background: transparent; padding: 8px; border-radius: 4px; }
.dialog-close:hover { background: #eeeadd; }
.dialog-eyebrow { color: var(--orange); font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.site-dialog h2 { font-family: var(--serif); font-size: 51px; font-weight: 400; line-height: 1; letter-spacing: -1px; margin: 0 0 18px; max-width: 95%; }
.site-dialog p { line-height: 1.6; }
.dialog-description { margin: 0 0 26px; color: var(--muted); }
.level-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0 0; }
.level-option { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; min-height: 67px; border: 1px solid var(--line); border-radius: 7px; background: transparent; padding: 16px 12px; font-weight: 500; font-size: 18px; }
.level-option:hover { border-color: var(--ink); background: #f0f0e4; }
.dialog-back { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; padding: 0; font-size: 14px; color: var(--muted); }
.info-dialog .button-primary { margin-top: 22px; text-decoration: none; }
.info-dialog h2:focus { outline: none; }
#info-content > p { color: var(--muted); }
.sign-in-form { display: grid; gap: 20px; }
.sign-in-field { display: grid; gap: 8px; }
.sign-in-field label { font-size: 16px; font-weight: 500; }
.sign-in-field input, .sign-in-field select { width: 100%; min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 7px; padding: 12px 14px; color: var(--ink); background: #fffdf8; font-family: inherit; font-size: 16px; }
.sign-in-field input:focus-visible, .sign-in-field select:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.password-recovery-link { justify-self: end; color: var(--muted); font-size: 14px; text-underline-offset: 3px; }
.password-recovery-link:hover { color: var(--ink); }
.sign-in-form .button-primary { width: 100%; margin-top: 4px; }
.auth-switch { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.auth-switch a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.registration-plans { display: grid; gap: 12px; }
.registration-plan { display: grid; width: 100%; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 16px 18px; background: #fffdf8; color: var(--ink); text-align: left; text-decoration: none; transition: border-color 160ms, background 160ms; }
.registration-plan:hover { border-color: var(--ink); background: #f4f0e4; }
.registration-plan:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.registration-plan strong { font: 24px/1.1 var(--serif); font-weight: 400; }
.registration-plan span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.registration-form { display: grid; gap: 20px; }
.registration-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.registration-form .button-primary { width: 100%; }
.payment-field-label { font-size: 16px; font-weight: 500; }
.payment-element-shell { min-height: 90px; border: 1px solid var(--line); border-radius: 9px; padding: 14px; background: #fffdf8; }
.payment-loading { color: var(--muted); font-size: 14px; line-height: 1.5; }
.registration-error { border: 1px solid #d49a90; border-radius: 7px; padding: 12px 14px; background: #fff1ec; color: #71312a; font-size: 14px; line-height: 1.5; }
.field-error { margin: 0; color: #71312a; font-size: 13px; line-height: 1.4 !important; }
.secure-payment-note { margin: -4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5 !important; }
.registration-return-card [data-registration-return-message] { margin-bottom: 24px; }
.sign-in-errors { color: #9c3315; font-size: 16px; line-height: 1.5; }
.sign-in-errors p { margin: 0; }
.signed-in-user { max-width: 220px; overflow-wrap: anywhere; font-size: 16px; }
.sign-out-form { margin: 0; }
.account-page { padding-block: 60px 90px; }
.account-card { max-width: 500px; margin-inline: auto; }
.account-card h1 { font-size: 52px; line-height: 1.1; letter-spacing: -1px; margin-bottom: 24px; }

@media (min-width: 1540px) {
  .hero { min-height: 820px; }
  .hero-copy { padding-top: 86px; }
}
@media (max-width: 1190px) {
  .page-shell { width: calc(100% - 72px); }
  .main-navigation { gap: 28px; }
  .hero { min-height: 665px; grid-template-columns: 48% 52%; }
  .hero-copy { padding-top: 50px; }
  h1 { font-size: 10.2vw; letter-spacing: -3px; }
  .eyebrow { font-size: 20px; }
  .hero-description { font-size: 20px; margin-top: 28px; }
  .hero-art { margin-top: 50px; }
  .hero-cta { min-width: 278px; min-height: 60px; font-size: 20px; }
  .curriculum-note { white-space: normal; max-width: 390px; font-size: 15px; }
  .stage-name { font-size: 48px; }
  .stage-description { font-size: 14px; }
}
@media (max-width: 1100px) {
  :root {
    --progress-sidebar-gap: 42px;
    --progress-sidebar-padding: 28px;
  }
}
@media (max-width: 860px) {
  .page-shell { width: calc(100% - 48px); }
  .site-header { min-height: 92px; }
  .wordmark { font-size: 52px; }
  .main-navigation { gap: 22px; }
  .main-navigation button, .main-navigation a { font-size: 15px; }
  .site-header { flex-wrap: wrap; gap: 0; }
  .menu-toggle { display: block; margin-right: -8px; }
  .main-navigation { display: none; width: 100%; align-items: stretch; padding-bottom: 22px; gap: 0; }
  .main-navigation.is-open { display: flex; flex-direction: column; }
  .main-navigation button, .main-navigation a { padding-block: 14px; text-align: left; font-size: 17px; border-bottom: 1px solid var(--line); }
  .main-navigation .sign-in-link { border-color: var(--line); }
  .hero { min-height: 620px; }
  .hero-copy { padding-top: 32px; }
  h1 { font-size: 11.2vw; letter-spacing: -2.7px; }
  .eyebrow { font-size: 17px; margin-bottom: 23px; }
  .hero-description { font-size: 18px; margin-top: 26px; }
  .desktop-break { display: none; }
  .hero-art { margin-top: 84px; margin-right: -15px; }
  .hero-cta { min-width: 245px; font-size: 18px; padding-inline: 20px; }
  .curriculum-note { font-size: 14px; max-width: 300px; }
  .stage-name { font-size: 38px; }
  .stage-description { max-width: 135px; min-height: 42px; }
}
@media (max-width: 620px) {
  .page-shell { width: calc(100% - 40px); }
  .site-header { min-height: 88px; flex-wrap: wrap; gap: 0; }
  .wordmark { font-size: 47px; letter-spacing: -1.4px; padding-bottom: 4px; }
  .menu-toggle { display: block; margin-right: -8px; }
  .main-navigation { display: none; width: 100%; align-items: stretch; padding-bottom: 22px; gap: 0; }
  .main-navigation.is-open { display: flex; flex-direction: column; }
  .main-navigation button, .main-navigation a { padding-block: 14px; text-align: left; font-size: 17px; border-bottom: 1px solid var(--line); }
  .main-navigation .sign-in-link { border-color: var(--line); }
  .hero { display: flex; flex-direction: column; min-height: 0; }
  .hero-copy { width: 100%; padding-top: 30px; }
  .eyebrow { font-size: 17px; letter-spacing: -.4px; margin-bottom: 25px; }
  h1 { font-size: clamp(77px, 21.9vw, 132px); line-height: .94; letter-spacing: -2.8px; }
  .hero-description { font-size: 18px; line-height: 1.5; max-width: 420px; margin: 27px 0 25px; letter-spacing: -.2px; }
  .hero-cta { min-height: 60px; width: 100%; max-width: 360px; justify-content: space-between; padding: 16px 23px; font-size: 20px; }
  .hero-cta img { width: 24px; height: 24px; }
  .curriculum-note { font-size: 14px; max-width: 330px; margin-top: 20px; line-height: 1.5; }
  .hero-art { margin: 12px -8px 17px; width: calc(100% + 16px); }
  .stages { padding-top: 22px; padding-bottom: 24px; }
  .stage-grid { grid-template-columns: repeat(2, 1fr); row-gap: 26px; margin-top: 28px; }
  .stage-choice { padding: 0 8px; }
  .stage-choice:nth-child(odd) { border-left: 0; }
  .stage-name { font-size: 40px; letter-spacing: -1px; }
  .stage-description { font-size: 13px; max-width: 160px; min-height: 39px; }
  .stage-symbol { width: 36px; height: 30px; margin-bottom: 10px; }
  .stage-underline { margin-top: 9px; width: 52px; }
  .site-dialog { width: calc(100% - 28px); max-height: calc(100dvh - 28px); padding: 45px 24px 28px; }
  .site-dialog h2 { font-size: 42px; }
  .site-dialog .button-primary { font-size: 16px; padding-inline: 16px; }
  .registration-fields { grid-template-columns: 1fr; }
  .dialog-close { top: 10px; right: 10px; }
  .level-option { min-height: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.stage-batxillerat .stage-symbol { width: 64px; }
