/* ============================================================
   CRAW Studio — Checkout (Acceso Beta)
   Reutiliza tokens y componentes de styles.css (cargado antes).
   ============================================================ */

.checkout-body { min-height: 100svh; }

/* Header: brand + volver (sin nav-pill) */
.co-header { grid-template-columns: 1fr auto; }
.co-back {
  justify-self: end;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--grey); font-family: var(--body-regular); font-size: 13px;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: color .2s, border-color .2s, background .2s;
}
.co-back:hover { color: var(--ink); border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.05); }

.co-main { position: relative; z-index: 3; padding: calc(var(--header-h) + clamp(28px,6vh,64px)) 0 clamp(60px,10vh,110px); }
.co-wrap { width: min(calc(100% - var(--edge) * 2), 1080px); }

.co-grid {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

/* ---------- Resumen / producto ---------- */
.co-summary {
  position: sticky; top: calc(var(--header-h) + 20px);
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.co-title { font-size: clamp(34px, 4vw, 52px); line-height: .9; margin-top: 14px; }
.co-plan { margin-top: 22px; }
.co-plan__badge {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,109,41,.14); border: 1px solid rgba(255,109,41,.4);
  color: var(--orange); font-family: var(--display); font-size: 11px;
  text-transform: uppercase; letter-spacing: .06em;
}
.co-plan__desc { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--grey); }
.co-plan__desc b { color: var(--ink); font-family: var(--body-regular); font-weight: 400; }
.co-plan__list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.co-plan__list li {
  position: relative; padding-left: 26px;
  font-size: 13.5px; color: var(--ink); line-height: 1.4;
}
.co-plan__list li::before {
  content: ""; position: absolute; left: 0; top: 2px;
  width: 16px; height: 16px; border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23161413' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat,
    var(--orange);
}

.co-price { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.co-price__row { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; color: var(--grey); }
.co-price__row + .co-price__row { margin-top: 12px; }
.co-price__old { color: var(--grey); text-decoration: line-through; opacity: .7; }
.co-price__row--total { font-size: 15px; color: var(--ink); font-family: var(--body-regular); }
.co-price__now { font-family: var(--display); font-size: 30px; color: var(--orange); }
.co-price__note { margin-top: 12px; font-size: 12px; line-height: 1.5; color: var(--grey); }

/* ---------- Panel de formulario ---------- */
.co-panel {
  padding: clamp(22px, 2.6vw, 36px);
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(20,18,17,.55);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.co-form { display: block; }
.co-fieldset { border: 0; padding: 0; margin: 0; }
.co-fieldset + .co-fieldset { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--line); }
.co-legend {
  display: flex; align-items: center; gap: 11px;
  font-family: var(--display); font-size: 15px; text-transform: uppercase; letter-spacing: .02em;
  color: var(--ink);
}
.co-step {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--orange); color: #161413;
  font-size: 13px; line-height: 1;
}

.co-fields { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.co-field { display: block; }
.co-field--wide, .co-field--promo { grid-column: 1 / -1; }
.co-field__label {
  display: block; margin-bottom: 8px;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--grey);
}
.co-field input,
.co-field select {
  width: 100%; height: 50px; padding: 0 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--ink); font-family: var(--body-regular); font-size: 15px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.co-field input::placeholder { color: rgba(255,255,255,.32); }
.co-field input:focus,
.co-field select:focus {
  outline: none; border-color: var(--orange);
  background: rgba(255,255,255,.06);
  box-shadow: 0 0 0 3px rgba(255,109,41,.18);
}
.co-field select { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23BABABA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}
.co-field select option { color: #161413; }
.co-field.has-err input,
.co-field.has-err select { border-color: var(--danger, #e0574a); }
.co-field__err { display: none; margin-top: 6px; font-size: 12px; color: #ff8a7d; }
.co-field.has-err .co-field__err { display: block; }
.co-field__hint { display: block; margin-top: 8px; font-size: 12px; color: var(--grey); }

/* ---------- Métodos de pago ---------- */
.co-methods { margin-top: 20px; display: grid; gap: 12px; }
.co-method {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  cursor: pointer; transition: border-color .2s, background .2s;
}
.co-method input { accent-color: var(--orange); width: 18px; height: 18px; flex: none; }
.co-method.is-active { border-color: rgba(255,109,41,.55); background: rgba(255,109,41,.07); }
.co-method__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.co-method__name { font-family: var(--body-regular); font-size: 14.5px; color: var(--ink); }
.co-method__sub { font-size: 12px; color: var(--grey); }
.co-method__tag {
  flex: none; padding: 5px 10px; border-radius: 999px;
  font-size: 11px; letter-spacing: .03em;
  background: rgba(255,109,41,.16); color: var(--orange);
}
.co-method__tag--soon { background: rgba(255,255,255,.07); color: var(--grey); }
.co-method.is-disabled { cursor: not-allowed; opacity: .55; }
.co-method { cursor: default; }
.co-method__ico {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: rgba(255,109,41,.14); color: var(--orange);
}

/* Banner "más métodos próximamente" */
.co-banner {
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; border-radius: 12px;
  border: 1px dashed var(--line);
  background: rgba(255,255,255,.03);
  color: var(--grey); font-size: 13px; line-height: 1.4;
}
.co-banner svg { flex: none; color: var(--orange); }
.co-banner b { color: var(--ink); font-family: var(--body-regular); font-weight: 400; }

/* ---------- Código promocional ---------- */
.co-promo { margin-top: 18px; }
.co-promo__inputwrap { position: relative; }
.co-promo__inputwrap input { padding-right: 46px; text-transform: uppercase; letter-spacing: .08em; }
.co-promo__status {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; display: grid; place-items: center;
}
.co-promo__inputwrap[data-co-state="checking"] .co-promo__status::after {
  content: ""; width: 15px; height: 15px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.25); border-top-color: var(--ink);
  animation: co-spin .7s linear infinite;
}
.co-promo__inputwrap[data-co-state="valid"] .co-promo__status::after {
  content: ""; width: 22px; height: 22px; border-radius: 999px; background: #37c07a;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.co-promo__inputwrap[data-co-state="invalid"] .co-promo__status::after {
  content: ""; width: 20px; height: 20px; border-radius: 999px; background: #e0574a;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 12px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.co-promo__inputwrap[data-co-state="valid"] input { border-color: #37c07a; box-shadow: 0 0 0 3px rgba(55,192,122,.16); }
.co-promo__inputwrap[data-co-state="invalid"] input { border-color: #e0574a; }
.co-field__hint.is-valid { color: #37c07a; }
.co-field__hint.is-invalid { color: #ff8a7d; }
@keyframes co-spin { to { transform: rotate(360deg); } }

/* ---------- Botón + legal ---------- */
.co-submit { margin-top: 28px; width: 100%; }
.co-submit > span { width: 100%; height: 54px; }
.co-submit[disabled] { pointer-events: none; opacity: .45; filter: grayscale(.3); }
.co-submit[disabled]::before, .co-submit[disabled]::after { opacity: 0 !important; }
.co-legal { margin-top: 16px; font-size: 11.5px; line-height: 1.55; color: var(--grey); text-align: center; }

/* ---------- Éxito ---------- */
.co-success { display: grid; place-items: center; min-height: 60svh; }
.co-success[hidden] { display: none; }
.co-success__card {
  max-width: 620px; width: 100%; text-align: center;
  padding: clamp(30px, 4vw, 52px) clamp(22px, 3vw, 44px);
  border-radius: 24px; border: 1px solid var(--line);
  background: rgba(20,18,17,.6);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.co-success__check {
  width: 74px; height: 74px; margin: 0 auto 22px; border-radius: 999px;
  display: grid; place-items: center; color: #161413; background: var(--orange);
  box-shadow: 0 0 0 8px rgba(255,109,41,.14), 0 18px 40px -12px rgba(255,109,41,.5);
  animation: co-pop .5s cubic-bezier(.2,1.3,.5,1) both;
}
@keyframes co-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.co-success .eyebrow { justify-content: center; }
.co-success__title { font-size: clamp(28px, 3.4vw, 44px); margin-top: 14px; }
.co-success__lead { margin: 18px auto 0; max-width: 46ch; font-size: 15px; line-height: 1.65; color: var(--grey); }
.co-success__lead b { color: var(--ink); font-family: var(--body-regular); font-weight: 400; }
.co-license {
  margin: 26px auto; max-width: 380px;
  padding: 18px; border-radius: 16px;
  border: 1px dashed rgba(255,109,41,.5); background: rgba(255,109,41,.06);
  display: flex; flex-direction: column; gap: 8px;
}
.co-license__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.co-license__key { font-family: var(--body-regular); font-size: 20px; letter-spacing: .12em; color: var(--ink); }
.co-license__exp { font-size: 12.5px; color: var(--grey); }
.co-license__exp b { color: var(--ink); }
.co-success__note { margin: 0 auto; max-width: 48ch; font-size: 13px; line-height: 1.6; color: var(--grey); }
.co-success__note a { color: var(--orange); }
.co-success__actions { margin-top: 28px; justify-content: center; }

/* ============================================================
   Generador de códigos (interno)
   ============================================================ */
.gen-tag {
  justify-self: end;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--grey); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
}
.gen-wrap { width: min(calc(100% - var(--edge) * 2), 640px); }
.gen-card {
  padding: clamp(26px, 3vw, 44px);
  border-radius: 22px; border: 1px solid var(--line);
  background: rgba(20,18,17,.55);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.gen-title { font-size: clamp(30px, 3.6vw, 46px); margin-top: 12px; }
.gen-lead { margin-top: 16px; font-size: 14px; line-height: 1.6; color: var(--grey); }
.gen-lead b { color: var(--ink); font-family: var(--body-regular); font-weight: 400; }
.gen-forwho { margin-top: 24px; }

.gen-output {
  margin-top: 18px; padding: 22px 18px; border-radius: 16px;
  border: 1px dashed rgba(255,109,41,.5); background: rgba(255,109,41,.06);
  text-align: center;
}
.gen-code {
  font-family: var(--body-regular); font-size: clamp(20px, 3.4vw, 30px);
  letter-spacing: .12em; color: var(--ink); word-break: break-all;
}
.gen-actions { margin-top: 20px; }
.gen-actions .btn-ghost { height: 48px; }

.gen-history { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.gen-history__head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--grey);
}
.gen-copyall {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--grey); font-size: 11px; transition: color .2s, border-color .2s;
}
.gen-copyall:hover { color: var(--ink); border-color: rgba(255,255,255,.28); }
.gen-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.gen-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
}
.gen-item__code { font-family: var(--body-regular); font-size: 14px; letter-spacing: .08em; color: var(--ink); }
.gen-item__who { font-size: 12px; color: var(--orange); }
.gen-item__copy {
  margin-left: auto; flex: none; padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--grey); font-size: 11px;
  transition: color .2s, border-color .2s;
}
.gen-item__copy:hover { color: var(--ink); border-color: rgba(255,255,255,.28); }
.gen-note { text-align: left; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .co-grid { grid-template-columns: 1fr; }
  .co-summary { position: static; order: -1; }
  .co-plan__list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .co-fields { grid-template-columns: 1fr; }
  .co-plan__list { grid-template-columns: 1fr; }
  .co-back span { display: none; }
}
