/* ═══════════════════════════════════════════════════════════════
   DRJ Cursos — learning platform sub-brand.
   Light, calm, study-friendly. DRJ red lives only in the logo mark;
   everything interactive uses the electric blue accent.
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #2A2A2A;
  --muted: #595959;
  --line: #E2E2DD;
  --line-2: #CFCFC9;
  --accent: #2F5BFF;
  --accent-ink: #1E43D6;
  --accent-soft: #E9EEFF;
  --red: #E61522;
  --ok: #117A3E;
  --ok-soft: #E4F5EA;
  --warn: #9A5B00;
  --warn-soft: #FFF3DC;
  --info: #1E43D6;
  --info-soft: #E9EEFF;
  --bad: #B3261E;
  --bad-soft: #FDE8E6;

  --font-ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'Courier New', monospace;
  --font-brand: 'Montserrat', Arial, sans-serif;

  --gutter: clamp(1rem, 5vw, 4rem);
  --max-w: 1200px;
  --header-h: 68px;
  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 1px 2px rgba(10, 10, 10, 0.04), 0 12px 32px -18px rgba(10, 10, 10, 0.22);
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

ol,
ul {
  list-style: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--accent);
  color: #fff;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.7rem 1rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: 1rem;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: 0.04em;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 0.75rem;
}

main {
  flex: 1;
}

main:focus {
  outline: none;
}

/* ─── Lockup ─────────────────────────────────────────────────── */
.lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.lockup__mark {
  display: inline-grid;
  place-items: center;
  height: 38px;
  padding: 0 0.6rem;
  border-radius: 7px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.lockup__rule {
  width: 2px;
  height: 38px;
  background: var(--ink);
}

.lockup__word {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lockup--sm .lockup__mark,
.lockup--sm .lockup__rule {
  height: 32px;
}

.lockup--sm .lockup__mark {
  font-size: 1rem;
}

.lockup--sm .lockup__word {
  font-size: 1.15rem;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}

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

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

.btn--primary:hover {
  background: var(--accent-ink);
}

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

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

.btn--lg {
  min-height: 52px;
  padding: 0.8rem 1.5rem;
  font-size: 1.02rem;
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

/* ─── Header ─────────────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 246, 244, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.top__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: var(--header-h);
}

.top__nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.top__nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.top__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.usermenu {
  position: relative;
}

.usermenu__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.usermenu__list {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.usermenu__who {
  padding: 0.5rem 0.7rem 0.6rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usermenu__list a,
.usermenu__list button {
  display: block;
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 0.92rem;
  text-decoration: none;
}

.usermenu__list a:hover,
.usermenu__list button:hover {
  background: var(--bg);
}

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 7vw, 5.5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 4.2vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__lead {
  max-width: 46ch;
  margin-top: 1.4rem;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-2);
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.75rem;
  margin-top: 2rem;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid transparent;
}

.link-arrow span {
  transition: transform 0.25s var(--ease);
}

.link-arrow:hover {
  color: var(--accent-ink);
}

.link-arrow:hover span {
  transform: translateX(3px);
}

/* Real client work, framed as browser windows */
.hero__work {
  position: relative;
}

.shot {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.05), 0 24px 48px -28px rgba(10, 10, 10, 0.35);
}

.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
}

.shot__bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: #FBFBF9;
}

.shot__bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line-2);
}

.shot__bar span {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shot--back {
  width: 84%;
  margin-left: auto;
}

.shot--front {
  width: 70%;
  margin-top: -26%;
}

.hero__caption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin-top: 1rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
}

.hero__caption b {
  font-weight: 600;
  color: var(--ink);
}

/* ─── Sections ───────────────────────────────────────────────── */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}

.section--white {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.section__aside {
  max-width: 40ch;
  color: var(--muted);
}

/* ─── Course cards ───────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  gap: 1.5rem;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.25s, transform 0.3s var(--ease), box-shadow 0.3s;
}

.card:hover {
  border-color: var(--line-2);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card__img {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #EDF0FF, #F6F6F4);
  overflow: hidden;
}

.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 1.3rem;
  color: #8C97C7;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.25rem 1.25rem 1.1rem;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.45rem;
}

/* The whole card is clickable through the title link */
.card__title a {
  text-decoration: none;
}

.card__title a::after {
  content: '';
  position: absolute;
  inset: 0;
}

.card__desc {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
}

.card__cta {
  font-weight: 600;
  color: var(--accent-ink);
}

.card--skeleton {
  pointer-events: none;
}

.sk {
  background: linear-gradient(90deg, #EDEDEA 25%, #F5F5F2 50%, #EDEDEA 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.sk--img {
  aspect-ratio: 16 / 9;
}

.sk--h {
  height: 18px;
  margin: 1.25rem 1.25rem 0.75rem;
  width: 60%;
  border-radius: 4px;
}

.sk--p {
  height: 12px;
  margin: 0 1.25rem 1.5rem;
  width: 85%;
  border-radius: 4px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.empty {
  grid-column: 1 / -1;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.empty h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.empty p {
  max-width: 52ch;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Catalog with no published courses yet: an editorial note, not a placeholder box */
.note {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem 3rem;
  align-items: end;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}

.note h3 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 0.5rem;
}

.note p {
  max-width: 56ch;
  color: var(--ink-2);
}

/* ─── Cómo se paga ───────────────────────────────────────────── */
.pay {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: center;
}

.pay__steps {
  counter-reset: step;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
}

.pay__steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.pay__steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--accent);
}

.pay__steps h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pay__steps p {
  margin-top: 0.25rem;
  color: var(--muted);
}

/* Yape-style receipt, built in HTML so it stays sharp */
.receipt {
  justify-self: center;
  width: min(100%, 300px);
  padding: 1.5rem 1.4rem 1.25rem;
  border-radius: 22px;
  background: #742284;
  color: #fff;
  box-shadow: 0 30px 60px -30px rgba(70, 20, 90, 0.6);
  transform: rotate(-2deg);
}

.receipt__app {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receipt__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.receipt__ok {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #19C5A6;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0B2F29;
}

.receipt__amount {
  margin: 1.25rem 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.receipt__amount small {
  font-size: 0.45em;
  font-weight: 700;
}

.receipt__rows {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.86rem;
}

.receipt__rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.receipt__rows dt {
  color: rgba(255, 255, 255, 0.72);
}

.receipt__rows dd {
  font-weight: 600;
}

.receipt__note {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
}

/* ─── Quién enseña ───────────────────────────────────────────── */
.who {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr);
  gap: 1.5rem clamp(2rem, 6vw, 5rem);
}

.who__lead {
  max-width: 60ch;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-2);
}

.who__lead a,
.who__own a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.who__clients {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin: 1.75rem 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.who__clients li:not(:last-child)::after {
  content: '/';
  margin: 0 0.6rem;
  font-weight: 400;
  color: var(--line-2);
}

.who__own {
  color: var(--muted);
}

/* ─── Preguntas ──────────────────────────────────────────────── */
.faq {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
}

.faq__row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 0.5rem clamp(2rem, 5vw, 4rem);
  padding: 1.35rem 0;
  border-bottom: 1px solid var(--line);
}

.faq dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}

.faq dd {
  max-width: 58ch;
  color: var(--ink-2);
}

.faq dd a {
  color: var(--accent-ink);
}

/* ─── Course detail ──────────────────────────────────────────── */
.course {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.crumbs {
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

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

.course__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.course__img {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #EDF0FF, #F6F6F4);
  margin-bottom: 1.5rem;
}

.course__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

.course__desc {
  color: var(--ink-2);
  white-space: pre-line;
  margin-bottom: 2rem;
}

.block-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.resources {
  display: grid;
  gap: 0.5rem;
}

.resource {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.95rem;
  text-decoration: none;
}

.resource__type {
  flex-shrink: 0;
  min-width: 52px;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
}

.resource__name {
  flex: 1;
  min-width: 0;
}

.resource--locked {
  color: var(--muted);
}

.resource--locked::after {
  content: '🔒';
  font-size: 0.85rem;
}

a.resource:hover {
  border-color: var(--accent);
}

.buy {
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.buy__price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.buy__note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.buy__steps {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: 0.9rem;
  counter-reset: buy;
}

.buy__steps li {
  counter-increment: buy;
  display: flex;
  gap: 0.5rem;
}

.buy__steps li::before {
  content: counter(buy);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.status {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.status--ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.status--info {
  background: var(--info-soft);
  color: var(--info);
}

.status--bad {
  background: var(--bad-soft);
  color: var(--bad);
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form {
  display: grid;
  gap: 0.9rem;
}

.form__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-2);
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 400;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input[type="file"] {
  padding: 0.55rem;
  font-size: 0.9rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 91, 255, 0.18);
}

.field input:disabled {
  background: var(--bg);
  color: var(--muted);
}

.form__error {
  min-height: 1.2em;
  font-size: 0.88rem;
  color: var(--bad);
}

.form__error:empty {
  min-height: 0;
}

.form__status {
  font-size: 0.88rem;
}

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

.form__status.is-bad {
  color: var(--bad);
}

/* ─── Mi aprendizaje ─────────────────────────────────────────── */
.learn {
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}

.learn__head {
  margin-bottom: 1.5rem;
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tabs a {
  padding: 0.75rem 1rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.tabs a[aria-selected="true"] {
  border-color: var(--accent);
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.table th,
.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.table th {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
}

.table tr:last-child td {
  border-bottom: 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}

.badge--pending {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge--pre_approved {
  background: var(--info-soft);
  color: var(--info);
}

.badge--approved {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge--rejected {
  background: var(--bad-soft);
  color: var(--bad);
}

.profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 900px;
}

.profile .form {
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  align-content: start;
}

.profile .btn {
  justify-self: start;
}

/* ─── Viewer ─────────────────────────────────────────────────── */
.viewer {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
}

.viewer__side {
  padding: 1.5rem;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.viewer__back {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

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

.viewer__title {
  margin: 1rem 0 1.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.viewer__list {
  display: grid;
  gap: 0.35rem;
  counter-reset: lesson;
}

.viewer__list button {
  display: flex;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-size: 0.92rem;
  counter-increment: lesson;
}

.viewer__list button::before {
  content: counter(lesson, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.12rem;
}

.viewer__list button:hover {
  background: var(--bg);
}

.viewer__list button[aria-current="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.viewer__stage {
  padding: clamp(1rem, 3vw, 2rem);
}

.viewer__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  background: #000;
}

.viewer__frame--pdf {
  aspect-ratio: auto;
  height: calc(100vh - var(--header-h) - 6rem);
  background: var(--surface);
  border: 1px solid var(--line);
}

.viewer__link {
  display: grid;
  place-items: center;
  gap: 1rem;
  min-height: 320px;
  padding: 2rem;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.viewer__caption {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

/* ─── Footer ─────────────────────────────────────────────────── */
.foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 2rem 0;
}

.foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}

.foot__links a {
  color: var(--muted);
  text-decoration: none;
}

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

.foot__copy {
  width: 100%;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ─── Dialog ─────────────────────────────────────────────────── */
.dialog {
  width: min(440px, calc(100% - 2rem));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(10, 10, 10, 0.45);
}

.dialog::backdrop {
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(3px);
}

.dialog__box {
  position: relative;
  display: grid;
  gap: 1.1rem;
  padding: 1.75rem;
}

.dialog__close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
}

.dialog__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.dialog__note {
  font-size: 0.8rem;
  color: var(--muted);
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
}

.seg button {
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-weight: 600;
  color: var(--muted);
}

.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(10, 10, 10, 0.12);
}

/* ─── WhatsApp ───────────────────────────────────────────────── */
.wa {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(1rem, 3vw, 1.75rem);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(37, 211, 102, 0.6);
  transition: transform 0.25s var(--ease);
}

.wa:hover {
  transform: scale(1.06);
}

.wa svg {
  width: 26px;
  height: 26px;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .course__grid {
    grid-template-columns: 1fr;
  }

  .buy {
    position: static;
  }

  .hero__inner,
  .pay,
  .who {
    grid-template-columns: 1fr;
  }

  .hero__work {
    max-width: 620px;
  }

  .receipt {
    justify-self: center;
    transform: rotate(-1.5deg);
  }

  .viewer {
    grid-template-columns: 1fr;
  }

  .viewer__side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .viewer__frame--pdf {
    height: 70vh;
  }
}

@media (max-width: 720px) {
  .top__nav {
    display: none;
  }

  .top__actions {
    margin-left: auto;
  }

  .profile {
    grid-template-columns: 1fr;
  }

  .faq__row,
  .note {
    grid-template-columns: 1fr;
  }

  .shot--back {
    width: 90%;
  }

  .shot--front {
    width: 78%;
  }
}

@media (max-width: 420px) {
  .lockup__word {
    font-size: 1.15rem;
  }

  .lockup__mark,
  .lockup__rule {
    height: 34px;
  }

  .top__actions .btn {
    padding: 0.5rem 0.85rem;
  }

  /* The avatar menu already links to Mis cursos */
  #btn-learn {
    display: none;
  }
}

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