@charset "UTF-8";
:root {
  --ink: #14110c;
  --ink-2: #1d1913;
  --ink-3: #2a241a;
  --ink-4: #353018;
  --paper: #f4ede0;
  --paper-dim: #b8ad99;
  --amber: #f0a830;
  --amber-deep: #c97f1a;
  --line: #3a3225;
  --ok: #8fb86a;
  --err: #e07070;
  --blue: #7ab8e8;
  --pink: #e8a0c0;
}

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

html { height: 100%; }

body {
  background: #14110c;
  color: #f4ede0;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.6;
}

.serif {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
}

button { font-family: inherit; cursor: pointer; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid #3a3225;
  background: #1d1913;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
}

.topbar-sep   { color: #3a3225; font-size: 18px; }
.topbar-spacer { flex: 1; }

.topbar-crumb { font-size: 12px; color: #b8ad99; }
.topbar-crumb b { color: #f4ede0; }

.topbar-doc-link {
  color: #b8ad99;
  text-decoration: none;
  font-size: .8rem;
  transition: color .15s;
}
.topbar-doc-link:hover { color: #f0a830; }

.logo {
  font-size: 20px;
  letter-spacing: -.5px;
  text-decoration: none;
  color: #f4ede0;
  flex-shrink: 0;
}
.logo .serif { font-size: 25px; font-style: italic; color: #f0a830; }

/* ── API key field ───────────────────────────────────────────────────────── */
.keyfield {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #b8ad99;
}
.keyfield input {
  background: #14110c;
  border: 1px solid #3a3225;
  color: #f4ede0;
  padding: 6px 10px;
  border-radius: 3px;
  font-family: inherit;
  font-size: 11px;
  width: 220px;
  outline: none;
}
.keyfield input:focus { border-color: #c97f1a; }

/* ── Status dot ──────────────────────────────────────────────────────────── */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b8ad99;
  flex-shrink: 0;
}
.dot.on  { background: #8fb86a; }
.dot.off { background: #e07070; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #353018;
  border: 1px solid #c97f1a;
  color: #f4ede0;
  padding: 11px 20px;
  border-radius: 4px;
  font-size: 13px;
  transition: transform .25s;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err  { border-color: #e07070; }

/* ── Body / layout ───────────────────────────────────────────────────────── */
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-image:
    repeating-linear-gradient(0deg,   transparent, transparent 39px, rgba(240,168,48,.025) 39px, rgba(240,168,48,.025) 40px),
    repeating-linear-gradient(90deg,  transparent, transparent 39px, rgba(240,168,48,.025) 39px, rgba(240,168,48,.025) 40px);
}

.content {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 28px 100px;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 72px;
}

/* ── Account summary ─────────────────────────────────────────────────────── */
.account-box {
  display: flex;
  align-items: center;
  background: #1d1913;
  border: 1px solid #3a3225;
  border-radius: 4px;
  overflow: hidden;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 28px;
}

.account-sep {
  width: 1px;
  align-self: stretch;
  background: #3a3225;
  flex-shrink: 0;
}

.field-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #b8ad99;
}

.plan-badge {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f0a830;
}

.credits-val {
  font-size: 22px;
  font-weight: 700;
  color: #f4ede0;
  letter-spacing: -1px;
}

.email-val { font-size: 13px; color: #b8ad99; }

/* ── Section headings (same as landing) ──────────────────────────────────── */
.sec-label {
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: #f0a830;
  margin-bottom: 14px;
}

.sec-title {
  font-size: clamp(28px, 3.5vw, 46px);
  letter-spacing: -1px;
  line-height: 1.05;
  margin-bottom: 8px;
}
.sec-title .serif { font-style: italic; color: #f0a830; font-weight: 400; }

.sec-sub {
  font-size: 12px;
  color: #b8ad99;
  margin-bottom: 32px;
}

/* ── Price grid ──────────────────────────────────────────────────────────── */
.price-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .price-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .price-grid { grid-template-columns: 1fr; } }

/* ── Price card (identical to landing) ───────────────────────────────────── */
.price-card {
  background: #1d1913;
  border: 1px solid #3a3225;
  border-radius: 4px;
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.price-card.feat { border-color: #f0a830; }
.price-card.feat::before {
  content: "más popular";
  position: absolute;
  top: -10px;
  right: 18px;
  background: #f0a830;
  color: #14110c;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 2px;
}
/* Si el plan feat ES el actual, el badge explícito "actual" lo sustituye */
.price-card.feat.current::before { display: none; }

.price-name {
  font-size: 13px;
  color: #b8ad99;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.price-amt {
  font-size: 52px;
  margin: 12px 0 4px;
  letter-spacing: -1px;
  line-height: 1;
}
.price-amt.price-amt-sm { font-size: 32px; letter-spacing: -.5px; }
.price-amt .serif { font-style: italic; }
.price-amt small  { font-size: 15px; color: #b8ad99; }

.price-sub {
  font-size: 12px;
  color: #b8ad99;
  margin-bottom: 6px;
  line-height: 1.5;
}

.price-credits {
  font-size: 13px;
  color: #f0a830;
  margin-bottom: 20px;
}

.price-divider {
  border: none;
  border-top: 1px solid #3a3225;
  margin: 14px 0;
}

.price-list {
  list-style: none;
  font-size: 13px;
  color: #b8ad99;
  flex: 1;
}
.price-list li {
  padding: 5px 0 5px 20px;
  position: relative;
  line-height: 1.5;
}
.price-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #f0a830;
}
.price-list li.no         { opacity: .4; }
.price-list li.no::before { content: "✕"; color: #b8ad99; }

/* ── Price card buttons ───────────────────────────────────────────────────── */
.price-cta {
  margin-top: 22px;
  display: block;
  width: 100%;
  text-align: center;
  font-family: inherit;
  font-size: 13px;
  padding: 11px 0;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 500;
  transition: opacity .15s, transform .12s, box-shadow .12s;
  border: none;
  cursor: pointer;
}
.price-cta:hover:not(:disabled) { opacity: .85; }

.price-cta-primary {
  background: #f0a830;
  color: #14110c;
  border: 1px solid #f0a830;
  box-shadow: 2px 2px 0 #c97f1a;
}
.price-cta-primary:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #c97f1a;
  opacity: 1;
}
.price-cta-primary:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 2px 2px 0 #c97f1a;
}

.price-cta-ghost {
  background: transparent;
  color: #b8ad99;
  border: 1px solid #3a3225;
}
.price-cta-ghost:hover:not(:disabled) {
  border-color: #f0a830;
  color: #f4ede0;
  opacity: 1;
}

/* Plan actual: apariencia neutra */
.price-cta.active-plan {
  background: transparent;
  color: #b8ad99;
  border: 1px solid #3a3225;
  cursor: default;
  opacity: 1;
}

/* ── Badge "actual" para el plan en uso ──────────────────────────────────── */
.plan-current-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  background: #c97f1a;
  color: #14110c;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 0 0 3px 3px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Estado vacío ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}
.empty-state .serif {
  font-size: 42px;
  font-style: italic;
  color: #f0a830;
  display: block;
  margin-bottom: 14px;
}
.empty-state p {
  font-size: 14px;
  color: #b8ad99;
  max-width: 38ch;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Modal de confirmación ───────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 12, .75);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: #1d1913;
  border: 1px solid #3a3225;
  border-radius: 6px;
  padding: 36px 32px 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.modal-icon {
  font-size: 28px;
  margin-bottom: 16px;
  line-height: 1;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: #f4ede0;
  margin-bottom: 10px;
}

.modal-body {
  font-size: 13px;
  color: #b8ad99;
  line-height: 1.7;
  margin-bottom: 28px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 3px;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .12s, box-shadow .12s;
}
.modal-btn:hover { opacity: .85; }

.modal-btn-cancel {
  background: transparent;
  color: #b8ad99;
  border: 1px solid #3a3225;
}
.modal-btn-cancel:hover {
  border-color: #b8ad99;
  color: #f4ede0;
  opacity: 1;
}

.modal-btn-confirm {
  background: #f0a830;
  color: #14110c;
  border: 1px solid #f0a830;
  box-shadow: 2px 2px 0 #c97f1a;
}
.modal-btn-confirm:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #c97f1a;
  opacity: 1;
}
.modal-btn-confirm.danger {
  background: #e07070;
  border-color: #e07070;
  box-shadow: 2px 2px 0 #a04040;
}
.modal-btn-confirm.danger:hover { box-shadow: 3px 3px 0 #a04040; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .account-box    { flex-direction: column; }
  .account-sep    { width: auto; height: 1px; align-self: stretch; }
  .content        { padding: 32px 16px 80px; }
}
