/* Configurador. Reusa los tokens y los controles de widget.css para no
   mantener dos sistemas visuales; aca va solo la disposicion propia.

   Escala tipografica: h1 30 / lead 16 / titulos de bloque 13 / labels y
   ayuda 13. El widget usa tamanos mas chicos porque vive en un panel de 400
   px; esta pagina se lee a pantalla completa. */

.tw-cfg { background: var(--tw-surface); }

.cfg-app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

/* ------------------------------------------------------------- cabecera */
.cfg-hero { max-width: 720px; margin-bottom: 30px; }
.cfg-eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--tw-accent-text);
}
.cfg-hero h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 700;
}
.cfg-lead {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--tw-text-soft);
}
.cfg-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tw-text-soft);
}
.cfg-steps li { display: flex; align-items: center; gap: 8px; }
.cfg-steps span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--tw-accent-soft);
  color: var(--tw-accent-text);
  font-size: 12px;
  font-weight: 700;
}

/* ------------------------------------------------------------- layout */
.cfg-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cfg-form,
.cfg-main {
  background: var(--tw-bg);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-r-xl);
  box-shadow: var(--tw-shadow);
}
.cfg-form { padding: 6px 24px 24px; }
.cfg-main {
  padding: 22px 24px 24px;
  min-width: 0;
  /* La vista previa acompana el scroll: se cambia una opcion y se ve el
     efecto sin volver arriba. */
  position: sticky;
  top: 20px;
}

/* Bloques del formulario, separados por una linea y aire. */
.cfg-block { padding: 22px 0 4px; }
.cfg-block + .cfg-block { border-top: 1px solid var(--tw-border); }
/* Aclaracion bajo un titulo de bloque: contexto, no instruccion. */
.cfg-block-note {
  margin: -4px 0 14px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--tw-text-faint);
}

.cfg-block-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tw-text-faint);
}

.cfg-form label { font-size: 13px; margin-top: 16px; }
.cfg-form .tw-help { font-size: 13px; }

/* Modo: tres tarjetas que funcionan como radios. */
.cfg-modes { display: grid; gap: 8px; }
.cfg-mode {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin: 0;
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-r);
  cursor: pointer;
  font-weight: 400;
  transition: border-color .15s ease, background .15s ease;
}
.cfg-mode:hover { border-color: var(--tw-text-faint); }
.cfg-mode:has(input:checked) {
  border-color: var(--tw-accent);
  background: var(--tw-accent-soft);
  box-shadow: inset 0 0 0 1px var(--tw-accent);
}
.cfg-mode input { grid-row: 1 / span 2; margin: 0; accent-color: var(--tw-accent); }
.cfg-mode-icon {
  grid-row: 1 / span 2;
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 10px;
  background: var(--tw-surface);
  color: var(--tw-text-soft);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cfg-mode:has(input:checked) .cfg-mode-icon {
  background: var(--tw-bg);
  color: var(--tw-accent-text);
}
.cfg-mode-title { font-weight: 600; font-size: 14px; }
.cfg-mode-desc { font-size: 12.5px; color: var(--tw-text-soft); line-height: 1.4; }

.cfg-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  font-weight: 500;
  cursor: pointer;
}
.cfg-check input { margin: 0; width: 16px; height: 16px; accent-color: var(--tw-accent); }

.cfg-color { display: flex; align-items: center; gap: 8px; }
.cfg-color input[type="text"] { flex: 1; min-width: 0; }
.cfg-color input[type="color"] {
  width: 44px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--tw-border-strong);
  border-radius: var(--tw-r-sm);
  background: var(--tw-field);
  cursor: pointer;
  flex: none;
}
.cfg-color .tw-secondary { width: auto; flex: none; padding-left: 14px; padding-right: 14px; }

.cfg-only[hidden] { display: none; }

/* ------------------------------------------------------------- vista previa */
.cfg-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.cfg-preview-head .cfg-block-title { margin: 0; }
.cfg-inline-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--tw-text-soft);
}
.cfg-inline-label select { width: auto; padding: 7px 30px 7px 10px; font-size: 13px; }

.cfg-canvas {
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-r);
  overflow: hidden;
  background: repeating-conic-gradient(var(--tw-surface) 0 25%, var(--tw-bg) 0 50%) 0 0 / 18px 18px;
}
.cfg-canvas iframe {
  display: block;
  width: 100%;
  height: 600px;
  border: 0;
  background: transparent;
}
.cfg-preview-note { margin: 10px 0 0; font-size: 13px; }

/* ------------------------------------------------------------- codigo */
.cfg-code { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--tw-border); }
.cfg-code-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cfg-code-head .cfg-block-title { margin: 0; }
.cfg-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--tw-surface);
  border: 1px solid var(--tw-border);
  color: var(--tw-text-faint);
}
.cfg-code .tw-help { margin: 0 0 12px; font-size: 13px; }

.tw-code {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-r);
  background: var(--tw-surface);
  color: var(--tw-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.cfg-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cfg-actions .tw-primary,
.cfg-actions .tw-secondary { width: auto; min-width: 190px; }
.cfg-actions a.tw-secondary { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* ------------------------------------------------------------- pie */
.cfg-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--tw-border);
  font-size: 13px;
  color: var(--tw-text-faint);
}
.cfg-footer a { color: var(--tw-accent-text); font-weight: 500; text-decoration: none; }
.cfg-footer a:hover { text-decoration: underline; }

@media (max-width: 940px) {
  .cfg-app { padding-top: 32px; }
  .cfg-hero h1 { font-size: 26px; }
  /* minmax(0, ...) y no 1fr a secas: el bloque de codigo no ajusta lineas y
     con 1fr obligaria a la pagina entera a scrollear de costado. */
  .cfg-layout { grid-template-columns: minmax(0, 1fr); }
  .cfg-main { position: static; }
  .cfg-canvas iframe { height: 540px; }
}
