/* Owner's guide (guia-propietario.html).
   Loaded after styles.css + legal.css: reuses the tokens, fonts, header and footer.
   Motion follows the landing's personality — one easing curve (0.22, 1, 0.36, 1),
   entrances 0.4–0.6 s, feedback ≤ 200 ms, no overshoot. */

.guide-body {
  --guide-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --guide-serif: "Ogg Medium", "Prata", Georgia, serif;
  --guide-card: rgba(253, 241, 225, 0.04);
  --guide-card-strong: rgba(253, 241, 225, 0.07);
}

.guide-main {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 6vh, 64px) clamp(20px, 4vw, 48px) clamp(72px, 10vh, 120px);
}

/* Reveal-on-scroll (guia.js adds .is-visible). Same recipe as the landing. */
.guide-main [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 0.6s var(--guide-ease) var(--reveal-delay, 0s),
    transform 0.6s var(--guide-ease) var(--reveal-delay, 0s);
}

.guide-main [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ---------- */

.guide-hero {
  margin-bottom: clamp(36px, 6vh, 56px);
}

.guide-eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.guide-hero h1 {
  margin: 0 0 18px;
  font-family: var(--guide-serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 5.2vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--paper);
  text-wrap: balance;
}

.guide-lead {
  margin: 0;
  max-width: 60ch;
  font-size: 1.14rem;
  line-height: 1.6;
  color: var(--paper-dim);
}

/* ---------- Calculator ---------- */

.guide-calc {
  position: relative;
  margin-bottom: clamp(56px, 9vh, 96px);
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(13, 151, 200, 0.14), transparent 60%),
    var(--guide-card);
  overflow: hidden;
}

/* Ambient layer: a slow drifting glow behind the result, so the card feels alive
   without competing with the number. */
.guide-calc::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 151, 200, 0.16), transparent 65%);
  animation: guide-glow 9s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes guide-glow {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-8%, -10%, 0) scale(1.12); }
}

.guide-calc > * {
  position: relative;
}

.guide-calc h2 {
  margin: 0 0 22px;
  font-family: var(--guide-serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  line-height: 1.1;
  color: var(--paper);
}

.calc-form {
  margin: 0 0 24px;
}

.calc-label {
  display: block;
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--paper);
}

.calc-hint {
  margin: 0 0 14px;
  font-size: 0.92rem;
  color: rgba(253, 241, 225, 0.5);
}

.calc-field {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  padding: 0 18px;
  border: 1px solid rgba(253, 241, 225, 0.22);
  border-radius: 16px;
  background: rgba(11, 17, 16, 0.6);
  transition:
    border-color 0.2s var(--guide-ease),
    box-shadow 0.2s var(--guide-ease),
    background-color 0.2s var(--guide-ease);
}

.calc-field:focus-within {
  border-color: var(--accent);
  background: rgba(11, 17, 16, 0.85);
  box-shadow: 0 0 0 4px rgba(13, 151, 200, 0.18);
}

.calc-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 16px 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  outline: none;
}

.calc-input::placeholder {
  color: rgba(253, 241, 225, 0.3);
}

.calc-unit {
  flex: 0 0 auto;
  font-size: 1rem;
  color: var(--paper-dim);
  white-space: nowrap;
}

.calc-result {
  margin: 0 0 18px;
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--guide-card-strong);
  border: 1px solid rgba(253, 241, 225, 0.1);
}

/* State swap: the incoming block lands from 8 px below, opacity 0→1. Exits are
   instant (hidden attribute), so entrances always win. */
.calc-result-main {
  animation: calc-state-in 0.4s var(--guide-ease) both;
}

@keyframes calc-state-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.calc-result-label {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--paper-dim);
}

.calc-result-low .calc-result-label {
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--paper);
}

.calc-result-figure {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 10px;
  margin: 0 0 8px;
}

.calc-result-number {
  font-family: var(--guide-serif);
  font-weight: 500;
  font-size: clamp(3rem, 8vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
  /* Secondary layer: a quick scale pop when the number lands (guia.js toggles). */
  display: inline-block;
  transform-origin: left bottom;
  transition: transform 0.35s var(--guide-ease);
}

.calc-result-number.is-settling {
  transform: scale(1.03);
}

.calc-result-unit {
  font-size: 1.1rem;
  color: var(--paper-dim);
}

.calc-result-sub {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--paper-dim);
}

.calc-result-sub strong {
  font-weight: 600;
  color: var(--paper);
}

.calc-footnote {
  margin: 0 0 22px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(253, 241, 225, 0.5);
}

/* ---------- Buttons ---------- */

.guide-cta {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 28px;
  border-radius: 999px;
  color: var(--ink);
  background: #fdf1e1;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.25s var(--guide-ease),
    box-shadow 0.25s var(--guide-ease);
}

.guide-cta span:first-child {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.25s var(--guide-ease);
}

.guide-cta:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
}

.guide-cta:hover span:first-child {
  transform: translate3d(2px, -2px, 0);
}

.guide-cta:active {
  transform: scale(0.98);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition-duration: 0.12s;
}

.guide-cta:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Sections ---------- */

.guide-section {
  margin-bottom: clamp(56px, 9vh, 96px);
}

.guide-section h2,
.guide-close h2 {
  margin: 0 0 16px;
  font-family: var(--guide-serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 3.4vw, 2.2rem);
  line-height: 1.1;
  color: var(--paper);
  text-wrap: balance;
}

.guide-section p,
.guide-close p {
  margin: 0 0 16px;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--paper-dim);
}

.guide-note {
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  font-size: 0.98rem !important;
  line-height: 1.55 !important;
}

/* Steps */

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.guide-steps li {
  padding: 22px 22px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--guide-card);
}

.guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: rgba(13, 151, 200, 0.16);
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.guide-steps h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--paper);
}

.guide-steps p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.55;
}

/* Fees table */

.guide-table {
  width: 100%;
  margin: 8px 0 18px;
  border-collapse: collapse;
  font-size: 1.05rem;
}

.guide-table th,
.guide-table td {
  padding: 14px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  line-height: 1.4;
  color: var(--paper-dim);
}

.guide-table th {
  font-weight: 500;
}

.guide-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.guide-table-total th,
.guide-table-total td {
  border-bottom: 0;
  padding-top: 18px;
  font-weight: 600;
  color: var(--paper);
}

.guide-table-total td {
  font-family: var(--guide-serif);
  font-weight: 500;
  font-size: 1.6rem;
}

/* FAQ */

.guide-faq {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.guide-faq details {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--guide-card);
  transition: background-color 0.25s var(--guide-ease);
}

.guide-faq details[open] {
  background: var(--guide-card-strong);
}

.guide-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--paper);
  cursor: pointer;
  list-style: none;
}

.guide-faq summary::-webkit-details-marker {
  display: none;
}

.guide-faq summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
  border-radius: 16px;
}

.guide-faq-icon {
  position: relative;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.guide-faq-icon::before,
.guide-faq-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  background: var(--paper-dim);
  border-radius: 2px;
  transition: transform 0.3s var(--guide-ease);
}

.guide-faq-icon::before {
  width: 14px;
  height: 2px;
}

.guide-faq-icon::after {
  width: 2px;
  height: 14px;
}

.guide-faq details.is-open .guide-faq-icon::after,
.guide-faq details[open]:not(.is-open):not(.is-closing) .guide-faq-icon::after {
  transform: rotate(90deg);
}

/* Answer: height animates via grid rows (guia.js keeps [open] while closing). */
.guide-faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.32s var(--guide-ease);
}

.guide-faq details.is-open .guide-faq-answer {
  grid-template-rows: 1fr;
}

.guide-faq-answer > div {
  overflow: hidden;
}

.guide-faq details p {
  margin: 0;
  padding: 0 20px 18px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--paper-dim);
}

/* Closing CTA */

.guide-close {
  padding: clamp(28px, 5vw, 44px);
  border-radius: 24px;
  text-align: center;
  background:
    radial-gradient(90% 120% at 50% 100%, rgba(13, 151, 200, 0.16), transparent 65%),
    var(--guide-card);
  border: 1px solid var(--line-soft);
}

.guide-close p {
  max-width: 44ch;
  margin: 0 auto 24px;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .guide-steps {
    grid-template-columns: 1fr;
  }

  .calc-field {
    max-width: none;
  }

  .calc-input {
    font-size: 1.5rem;
  }

  .guide-cta {
    width: 100%;
  }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .guide-main [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .guide-calc::before {
    animation: none;
  }

  .calc-result-main {
    animation: none;
  }

  .calc-result-number,
  .guide-cta,
  .guide-cta span:first-child,
  .guide-faq details,
  .guide-faq-icon::before,
  .guide-faq-icon::after,
  .guide-faq-answer {
    transition: none;
  }

  .guide-faq details[open] .guide-faq-answer {
    grid-template-rows: 1fr;
  }
}
