/*
 * Instructivo Spiral Reader — light theme (v4)
 * Layered on top of Astral main.css. Palette: royal blue #5463ef,
 * pink #F92E66, green #3FCC2B on a light, paper-like background.
 */

:root {
  --primary-blue-foother: #7b8ef0;
  --primary-green:        #5ecf62;

  --sr-blue:   #5463ef;
  --sr-blue-d: #3e4bd8;
  --sr-pink:   #F92E66;
  --sr-green:  #2fb01d;
  --sr-ink:    #1b2033;   /* main text */
  --sr-ink-2:  #3d4660;   /* body copy */
  --sr-muted:  #67708a;   /* secondary */
  --sr-soft:   #f4f6fb;   /* light fill */
  --sr-card:   #ffffff;   /* cards */
  --sr-line:   #e3e7f0;   /* hairlines */
  --sr-line-2: #d3d9e6;
  --sr-body-size: 1.06rem;
  --sr-body-leading: 1.58;
}

/* ---------- Step cards ---------- */
.step { max-width: 44rem; margin: 0 auto; text-align: left; }
.step h2 {
  font-size: 1.46rem; font-weight: 700;
  color: var(--sr-ink); margin: 0 0 .85rem;
  letter-spacing: .01em;
  line-height: 1.3;
}
.step h2 .num {
  display: inline-block;
  min-width: 2.15rem; height: 2.15rem;
  line-height: 2.15rem; text-align: center;
  border-radius: 999px;
  background: var(--sr-blue); color: #fff;
  font-size: .95rem; font-weight: 700;
  margin-right: .6rem; vertical-align: -2px;
  box-shadow: 0 4px 10px rgba(84,99,239,.25);
}
.step p  { color: var(--sr-ink-2); line-height: var(--sr-body-leading); margin: 0 0 .9rem; font-size: var(--sr-body-size); }
.step ol, .step ul { color: var(--sr-ink-2); padding-left: 1.25rem; margin: 0 0 .9rem; line-height: var(--sr-body-leading); font-size: var(--sr-body-size); }
.step ol li, .step ul li { margin-bottom: .35rem; }
.step ol { list-style: decimal; }
.step ul { list-style: disc; }
.step code, .step .ui {
  background: rgba(84,99,239,.10);
  color: var(--sr-blue);
  padding: .08em .4em;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 600;
  font-size: .94em;
}
.step .pink  { color: var(--sr-pink);  font-weight: 600; }
.step .green { color: var(--sr-green); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: .75rem 1.35rem;
  background: var(--sr-blue); color: #fff !important;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(84,99,239,.28);
}
.btn:hover { background: var(--sr-blue-d); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(84,99,239,.35); }
.btn.ghost  { background: #fff; border-color: var(--sr-line-2); color: var(--sr-ink) !important; box-shadow: none; }
.btn.ghost:hover { background: var(--sr-soft); border-color: var(--sr-blue); }
.btn.pink   { background: var(--sr-pink); box-shadow: 0 6px 16px rgba(249,46,102,.28); }
.btn.pink:hover { background: #d91e54; }

.anchor-buttons {
  display: flex; flex-wrap: wrap; gap: .6rem;
  justify-content: center;
  margin: 1.2rem 0 0;
}
.anchor-buttons a {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.1rem;
  background: #fff;
  border: 1px solid var(--sr-line);
  color: var(--sr-ink);
  border-radius: 999px;
  font-size: .95rem;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.anchor-buttons a:hover { background: var(--sr-soft); border-color: var(--sr-blue); box-shadow: 0 4px 12px rgba(84,99,239,.12); }
.anchor-buttons a i { color: var(--sr-blue); }

/* ---------- Slider ---------- */
.slider { max-width: 56rem; margin: 0 auto; }
.slider .slides { position: relative; min-height: 17rem; }
.slider .slide  { display: none; animation: sr-fade .3s ease-out; }
.slider .slide.active { display: block; }
@keyframes sr-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.slider-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-top: 1.5rem;
}
.slider-controls .prev,
.slider-controls .next {
  width: 2.5rem; height: 2.5rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--sr-line-2);
  color: var(--sr-ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, color .15s;
}
.slider-controls .prev:hover,
.slider-controls .next:hover { background: var(--sr-blue); border-color: var(--sr-blue); color: #fff; }
.slider-controls .counter {
  min-width: 4rem; text-align: center;
  color: var(--sr-muted);
  font-variant-numeric: tabular-nums;
  font-size: .95rem;
}

.navigation { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.navigation .dot {
  width: 1.9rem; height: 1.9rem;
  line-height: 1.9rem; text-align: center;
  border-radius: 999px;
  background: #fff;
  color: var(--sr-muted);
  cursor: pointer;
  font-size: .85rem;
  border: 1px solid var(--sr-line-2);
  transition: background .15s, color .15s, border-color .15s;
}
.navigation .dot:hover { color: var(--sr-blue); border-color: var(--sr-blue); }
.navigation .dot.active { background: var(--sr-blue); color: #fff; border-color: var(--sr-blue); }

/* ---------- Header area (hero) ---------- */
.hero { text-align: center; max-width: 46rem; margin: 0 auto; }
.hero .eyebrow {
  display: inline-block;
  font-size: .78rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--sr-pink); font-weight: 700;
  padding: .35rem .75rem;
  background: rgba(249,46,102,.08);
  border: 1px solid rgba(249,46,102,.25);
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.hero h1 { font-size: 2.35rem; color: var(--sr-ink); line-height: 1.18; margin: 0 0 .75rem; }
.hero h1 .accent { color: var(--sr-pink); }
.hero .lede { color: var(--sr-ink-2); line-height: 1.62; font-size: 1.12rem; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: .9rem;
  margin: 2.2rem auto 0;
  max-width: 52rem;
  text-align: left;
}
.quick-actions a {
  display: flex; align-items: center; gap: .85rem;
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--sr-line);
  border-radius: 14px;
  color: var(--sr-ink);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(27,32,51,.04);
}
.quick-actions a:hover { border-color: var(--sr-blue); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(84,99,239,.15); }
.quick-actions a .qa-icon {
  width: 2.4rem; height: 2.4rem;
  border-radius: 10px;
  background: rgba(84,99,239,.10);
  color: var(--sr-blue);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.quick-actions a .qa-title { font-weight: 600; font-size: 1.06rem; display: block; color: var(--sr-ink); line-height: 1.35; }
.quick-actions a .qa-sub   { color: var(--sr-muted); font-size: .92rem; line-height: 1.45; }

/* ---------- Panel heading ---------- */
.panel-head { text-align: center; margin-bottom: 1.6rem; }
.panel-head .plat-icon {
  font-size: 2rem; color: var(--sr-blue); margin-bottom: .5rem;
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem;
  background: rgba(84,99,239,.10);
  border-radius: 999px;
}
.panel-head h1 { font-size: 1.9rem; color: var(--sr-ink); margin: 0 0 .45rem; letter-spacing: -.005em; line-height: 1.2; }
.panel-head .subtitle { color: var(--sr-muted); font-size: 1.06rem; line-height: 1.5; }

.back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--sr-muted); font-size: .9rem;
  margin-bottom: 1.2rem;
}
.back-link:hover { color: var(--sr-blue); }

/* ---------- Callouts ---------- */
.callout {
  background: rgba(84,99,239,.06);
  border: 1px solid rgba(84,99,239,.18);
  border-left: 3px solid var(--sr-blue);
  padding: 1rem 1.1rem;
  border-radius: 0 10px 10px 0;
  margin: 1.1rem 0;
}
.callout .callout-title {
  font-weight: 700; color: var(--sr-ink); margin-bottom: .35rem;
  display: inline-flex; align-items: center; gap: .45rem;
}
.callout .callout-title i { color: var(--sr-blue); }
.callout p { color: var(--sr-ink-2); line-height: 1.55; margin: 0; font-size: 1rem; }
.callout.warning { background: rgba(249,46,102,.06); border-color: rgba(249,46,102,.22); border-left-color: var(--sr-pink); }
.callout.warning .callout-title, .callout.warning .callout-title i { color: var(--sr-pink); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 50rem; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--sr-line);
  background: #fff;
  border-radius: 12px;
  margin-bottom: .6rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(27,32,51,.03);
}
.faq-q {
  width: 100%;
  padding: 1.08rem 1.15rem;
  background: transparent;
  border: 0;
  color: var(--sr-ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  font-size: 1.02rem;
  line-height: 1.3;
}
.faq-q:hover { background: var(--sr-soft); }
.faq-q::after {
  content: "+";
  font-size: 1.4rem; font-weight: 400;
  color: var(--sr-blue);
  transition: transform .2s;
  flex-shrink: 0;
}
.faq-item.open .faq-q::after { content: "–"; }
.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease;
  color: var(--sr-ink-2);
  line-height: 1.6;
}
.faq-item.open .faq-a { max-height: 32rem; }
.faq-a .inner { padding: 0 1.15rem 1.15rem; font-size: 1rem; line-height: 1.56; }
.faq-a ul { padding-left: 1.2rem; margin: .4rem 0 0; }
.faq-a ul li { margin-bottom: .25rem; }

/* ---------- Download grid (inicio) ---------- */
.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .7rem;
  max-width: 52rem;
  margin: 1.5rem auto 0;
}
.downloads a {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  padding: 1.05rem 1.15rem;
  background: #fff;
  border: 1px solid var(--sr-line);
  border-radius: 12px;
  color: var(--sr-ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: 0 1px 2px rgba(27,32,51,.03);
}
.downloads a:hover { border-color: var(--sr-blue); box-shadow: 0 8px 20px rgba(84,99,239,.14); transform: translateY(-1px); }
.downloads a .dl-top { display: flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--sr-ink); font-size: 1rem; line-height: 1.4; }
.downloads a .dl-top i { color: var(--sr-blue); font-size: 1.15rem; }
.downloads a .dl-sub { font-size: .9rem; color: var(--sr-muted); padding-left: 1.7rem; line-height: 1.45; }

/* ---------- Section divider ---------- */
.divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 2rem 0 1.2rem;
  color: var(--sr-muted);
  font-size: .84rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--sr-line);
}

/* ---------- Checklist ---------- */
.check-list { list-style: none !important; padding: 0 !important; }
.check-list li {
  padding-left: 1.7rem; position: relative;
  margin-bottom: .5rem;
  color: var(--sr-ink-2);
}
.check-list li::before {
  content: "\f00c";
  font-family: "Font Awesome 5 Free"; font-weight: 900;
  color: var(--sr-green);
  position: absolute; left: 0; top: .1em;
}

/* ---------- Override Astral tint where needed (LIGHT THEME) ---------- */
/* Force a light page: body gets a soft tint, #main becomes a white card.
   This overrides both Astral's default and the legacy #f5f5f5 body rule. */
html, body {
  background: linear-gradient(135deg, var(--primary-blue-foother) 0%, var(--primary-green) 100%) !important;
  background-attachment: fixed !important;
  color: var(--sr-ink);
}
#main {
  background: #ffffff !important;
  box-shadow: 0 10px 40px rgba(27,32,51,.08), 0 1px 0 rgba(27,32,51,.04) inset !important;
  border: 1px solid var(--sr-line);
  border-radius: 14px;
  color: var(--sr-ink) !important;
}
#main { font-size: 1.03rem; }
#main, #main p, #main li { color: var(--sr-ink-2) !important; line-height: var(--sr-body-leading); }
#main h1, #main h2, #main h3, #main h4,
#main .hero h1, #main .panel-head h1, #main .step h2,
#main .callout .callout-title, #main .faq-q,
#main .downloads a .dl-top, #main .quick-actions a .qa-title,
#main .anchor-buttons a { color: var(--sr-ink) !important; }
#main a:not(.btn):not(.anchor-buttons a):not(.quick-actions a):not(.downloads a):not(.back-link):not(.faq-q) {
  color: var(--sr-blue);
}
#main .btn, #main .btn * { color: #fff !important; }
#main .btn.ghost, #main .btn.ghost * { color: var(--sr-ink) !important; }

#main > .panel { padding: 2.5rem 1.5rem !important; }
@media (min-width: 736px) {
  #main > .panel { padding: 3.5rem 2.5rem !important; }
}

/* Nav rail — full-brightness icons on the gradient backdrop */
#nav a { color: rgba(255,255,255,.95); }
#nav a:hover, #nav a.active { color: #fff; }

/* Tooltip triangle: match bg color and close the seam */
#nav a span {
  background: #333 !important;
  border-radius: 4px !important;
}
#nav a span:after {
  border-top-color: #333 !important;
  bottom: -0.38em !important;
}

/* Footer: sits on the gradient backdrop — ensure all text is readable */
#footer .copyright li,
#footer .copyright li * { color: rgba(255,255,255,.85) !important; }
#footer .copyright li a { color: #fff !important; text-decoration: underline; }
#footer .copyright li a[href^="mailto:sac"] { color: #F92E66 !important; }

/* ===================== MOBILE NAV — scrollable tab bar ===================== */

/* Hide desktop #nav on mobile — replaced by bottom tab bar */
@media screen and (max-width: 736px) {
  #nav { display: none !important; }
}
body.mobile-view #nav { display: none !important; }
body.mobile-view { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important; }

/* ---- Tab bar ---- */
#mn-tabbar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(135deg, var(--primary-blue-foother) 0%, var(--primary-green) 100%);
  flex-direction: row;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 .75rem;
  scrollbar-width: none;
  z-index: 1200;
  box-shadow: 0 -2px 20px rgba(0,0,0,.22);
  padding: .2rem .4rem env(safe-area-inset-bottom, 0px);
}
#mn-tabbar::-webkit-scrollbar { display: none; }
#mn-tabbar::before,
#mn-tabbar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: env(safe-area-inset-bottom, 0px);
  width: 1.25rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}
#mn-tabbar::before {
  left: 0;
  background: linear-gradient(to right, rgba(84,99,239,.8), rgba(84,99,239,0));
}
#mn-tabbar::after {
  right: 0;
  background: linear-gradient(to left, rgba(94,207,98,.85), rgba(94,207,98,0));
}
#mn-tabbar.mn-tabbar--can-scroll-left::before { opacity: 1; }
#mn-tabbar.mn-tabbar--can-scroll-right::after { opacity: 1; }

.mn-tab {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .68rem 1rem .62rem;
  gap: .3rem;
  text-decoration: none;
  color: rgba(255,255,255,.72);
  scroll-snap-align: center;
  min-width: 5rem;
  border-radius: 12px;
  margin: .3rem .1rem;
  transition: background .15s, color .15s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mn-tab:hover { color: #fff; background: rgba(255,255,255,.12); }
.mn-tab--active { color: #fff !important; background: rgba(255,255,255,.22) !important; }
.mn-tab:focus-visible {
  outline: 2px solid rgba(255,255,255,.95);
  outline-offset: -2px;
  color: #fff;
}
.mn-tab::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: .15rem;
  height: 2px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  transform: scaleX(.3);
  opacity: 0;
  transition: transform .15s ease, opacity .15s ease;
}
.mn-tab--active::after {
  transform: scaleX(1);
  opacity: 1;
}
.mn-tab-icon { font-size: 1.2rem; line-height: 1; }
.mn-tab-label {
  font-size: .7rem; font-weight: 700;
  letter-spacing: .01em; white-space: nowrap; text-transform: none;
  line-height: 1;
}


@media screen and (max-width: 736px) {
  /* --- Hero --- */
  .hero h1 { font-size: 1.5rem !important; }
  .hero .lede { font-size: .92rem !important; }
  .hero .eyebrow { font-size: .7rem !important; }

  /* --- Panel heading --- */
  .panel-head h1 { font-size: 1.3rem !important; }

  /* --- Step cards --- */
  .step h2 { font-size: 1.1rem !important; }
  .step p, .step ol, .step ul { font-size: .93rem !important; }

  /* --- Buttons: full-width on mobile --- */
  .btn {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: .85rem 1rem !important;
    font-size: .95rem !important;
  }

  /* --- Quick-actions grid: single column --- */
  .quick-actions {
    grid-template-columns: 1fr !important;
  }

  /* --- Downloads grid: single column --- */
  .downloads {
    grid-template-columns: 1fr !important;
  }

  /* --- Callouts --- */
  .callout { padding: .85rem .9rem !important; }
  .callout .callout-title { font-size: .92rem !important; }
  .callout p { font-size: .88rem !important; }

  /* --- FAQ --- */
  .faq-q { font-size: .93rem !important; padding: .85rem .9rem !important; }
  .faq-a .inner { font-size: .88rem !important; }

  /* --- Slider nav dots --- */
  .navigation .dot {
    width: 1.6rem !important; height: 1.6rem !important;
    line-height: 1.6rem !important; font-size: .78rem !important;
  }

  /* --- Panels: tighter padding --- */
  #main > .panel { padding: 1.75rem 1.1rem !important; }
}

/* Same rules triggered by JS class (for in-browser mobile preview) */

body.mobile-view .hero h1 { font-size: 1.5rem !important; }
body.mobile-view .hero .lede { font-size: .92rem !important; }
body.mobile-view .hero .eyebrow { font-size: .7rem !important; }

body.mobile-view .panel-head h1 { font-size: 1.3rem !important; }

body.mobile-view .step h2 { font-size: 1.1rem !important; }
body.mobile-view .step p,
body.mobile-view .step ol,
body.mobile-view .step ul { font-size: .93rem !important; }

body.mobile-view .btn {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: .85rem 1rem !important;
  font-size: .95rem !important;
}
body.mobile-view .quick-actions { grid-template-columns: 1fr !important; }
body.mobile-view .downloads { grid-template-columns: 1fr !important; }
body.mobile-view .callout { padding: .85rem .9rem !important; }
body.mobile-view .callout .callout-title { font-size: .92rem !important; }
body.mobile-view .callout p { font-size: .88rem !important; }
body.mobile-view .faq-q { font-size: .93rem !important; padding: .85rem .9rem !important; }
body.mobile-view .faq-a .inner { font-size: .88rem !important; }
body.mobile-view .navigation .dot {
  width: 1.6rem !important; height: 1.6rem !important;
  line-height: 1.6rem !important; font-size: .78rem !important;
}
body.mobile-view #main > .panel { padding: 1.75rem 1.1rem !important; }

/* Small helpers */
.text-center { text-align: center; }
.mt-1 { margin-top: .6rem; }
.mt-2 { margin-top: 1.2rem; }
.mt-3 { margin-top: 2rem; }
.mb-1 { margin-bottom: .6rem; }
.mb-2 { margin-bottom: 1.2rem; }

.scholar-logo { display: none; }

/* Safety net: Astral's `body.is-preload #wrapper { opacity: 0 }` sometimes
   doesn't get cleared in certain preview environments. Force visible. */
#wrapper { opacity: 1 !important; }

/* ---------- Nav fixes ---------- */
/* 1) Restore the FontAwesome Home glyph. main.css line ~2348 overrides
      .fa-home:before with content:' ' and an external SVG that may not load. */
#nav a.fa-home:before,
.fa-home:before {
  content: "\f015" !important;                 /* fa-home unicode */
  font-family: "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
  background-image: none !important;
  display: inline-block !important;
  height: auto !important;
}

/* 2) Tooltips: Astral caps the span at width:5.5em with a negative margin.
      Labels like "Recuperar contraseña" overflow. Let it auto-size. */
#nav a span {
  width: auto !important;
  min-width: 5.5em;
  padding: 0 .9em !important;
  margin-left: 0 !important;
  transform: translateX(-50%);
  white-space: nowrap !important;
  border-radius: 4px;
}
