/* =====================================================
   ARCHIVO GENERAL SAN JUAN — solicitar.css
   Componentes comunes a solicitar_busqueda.html y
   solicitar_copia.html. Requiere shared.css cargado antes.
   ===================================================== */

/* ─── Page layout ────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: block;
}

.search-section {
  padding: 40px 24px 80px;
  background: var(--cbg);
}

.search-container {
  max-width: 680px;
  margin: 0 auto;
}

.main-card {
  background: var(--csurf);
  border: 1px solid var(--cbrd);
  border-radius: 16px;
  padding: 40px;
}

/* ─── Page title ─────────────────────────────────────────────────────────── */
.search-title {
  font-family: var(--fu);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 400;
  color: var(--ct);
  line-height: 1.2;
  margin-bottom: 10px;
}

.search-title b,
.search-title strong { font-weight: 700; }

.search-subtitle {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.72;
  margin-bottom: 28px;
  max-width: 58ch;
}

/* ─── Progress bar ───────────────────────────────────────────────────────── */
.progress-bar {
  height: 4px;
  background: var(--cmuted);
  border-radius: 9999px;
  margin-bottom: 32px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--cp);
  border-radius: 9999px;
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ─── Alert ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-family: var(--fu);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.alert-error {
  background: oklch(from var(--cerr) l c h / 0.08);
  border: 1px solid oklch(from var(--cerr) l c h / 0.28);
  color: oklch(from var(--cerr) 38% calc(c * 0.72) h);
}

/* ─── Wizard ─────────────────────────────────────────────────────────────── */
.wizard-step        { display: none; }
.wizard-step.active { display: block; }

/* ─── Step header ────────────────────────────────────────────────────────── */
.step-header {
  font-family: var(--fu);
  font-size: 18px;
  font-weight: 700;
  color: var(--ct);
  margin-top: 16px;
  margin-bottom: 6px;
}

.step-sub {
  font-family: var(--fb);
  font-size: 16px;
  color: var(--ct2);
  line-height: 1.65;
  margin-bottom: 24px;
}

.section-label {
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 600;
  color: var(--ct);
  display: block;
  margin-bottom: 8px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--cbrd);
  margin: 24px 0 20px;
}

.section-title {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ct3);
  margin: 28px 0 12px;
}

/* ─── Intention buttons (paso 1) ─────────────────────────────────────────── */
.intentions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intention-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: var(--cbg);
  border: 1.5px solid var(--cbrd2);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  min-height: 60px;
}

.intention-btn:hover {
  border-color: var(--cp);
  background: oklch(from var(--cp) l c h / 0.04);
}

.intention-btn .icon {
  width: 36px;
  height: 36px;
  background: oklch(from var(--cp) l c h / 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cp-dk);
  flex-shrink: 0;
}

.intention-btn .label {
  font-family: var(--fu);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ct);
  line-height: 1.3;
}

.intention-btn .sub {
  font-family: var(--fb);
  font-size: 15px;
  color: var(--ct2);
  line-height: 1.4;
}

.intention-btn .arrow {
  margin-left: auto;
  font-size: 22px;
  color: var(--ct3);
  line-height: 1;
  flex-shrink: 0;
}

/* ─── Form ───────────────────────────────────────────────────────────────── */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label,
form label:not(.radio-label) {
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 600;
  color: var(--ct);
}

.form-group input:not([type="radio"]):not([type="hidden"]),
.form-group select,
.form-group textarea,
form input:not([type="radio"]):not([type="hidden"]),
form select,
form textarea {
  border: 1.5px solid var(--cbrd2);
  border-radius: 8px;
  padding: 10px 14px;
  font-family: var(--fu);
  font-size: 16px;
  color: var(--ct);
  background: var(--csurf);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

.form-group input:not([type="radio"]):focus,
.form-group select:focus,
.form-group textarea:focus,
form input:not([type="radio"]):not([type="hidden"]):focus,
form select:focus,
form textarea:focus {
  border-color: var(--cp);
  box-shadow: 0 0 0 3px oklch(from var(--cp) l c h / 0.15);
}

.form-group input::placeholder,
form input::placeholder {
  color: oklch(68% 0 0);
}

.input--narrow { max-width: 260px; }

.input-hint {
  font-family: var(--fb);
  font-size: 13px;
  color: var(--ct3);
  line-height: 1.5;
}

.email-error {
  display: none;
  font-family: var(--fu);
  font-size: 13px;
  font-weight: 600;
  color: var(--cerr);
}

.required,
.required-mark { color: var(--cerr); }

.form-legal-note {
  font-family: var(--fb);
  font-size: 13px;
  color: var(--ct3);
  line-height: 1.6;
  margin: 16px 0 20px;
}

/* ─── Radio buttons ──────────────────────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1.5px solid var(--cbrd2);
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--fu);
  font-size: 14px;
  font-weight: 500;
  color: var(--ct);
  transition: border-color 0.15s, background 0.15s;
  flex: 1;
  min-width: 160px;
  min-height: 44px;
}

.radio-label.checked {
  border-color: var(--cp);
  background: oklch(from var(--cp) l c h / 0.06);
  color: var(--cp-dk);
  font-weight: 700;
}

.radio-label input { accent-color: var(--cp); }

.radio-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ct3);
  transition: color 0.15s;
}

.radio-label.checked .radio-icon { color: var(--cp-dk); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
/* .gsj-button, .gsj-button--primary, --outline, --sm y .btn-full
   están definidos en shared.css. Aquí solo se agrega .btn-back-ghost. */

.btn-back-ghost { margin-bottom: 20px; }

/* ─── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--cbrd2);
  border-top-color: var(--cp);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid oklch(100% 0 0 / 0.45);
  border-top-color: oklch(100% 0 0);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

/* ─── Decree info (solicitar_copia) ──────────────────────────────────────── */
.decree-loading-state {
  text-align: center;
  padding: 32px;
  font-family: var(--fu);
  font-size: 14px;
  color: var(--ct2);
}

.decree-info {
  background: var(--cbg);
  border: 1px solid var(--cbrd);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.decree-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.decree-grid .label {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ct3);
  margin-bottom: 2px;
}

.value {
  font-family: var(--fu);
  font-size: 15px;
  font-weight: 700;
  color: var(--ct);
}

/* ─── Success panel ──────────────────────────────────────────────────────── */
.success-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0;
  gap: 12px;
}

.success-icon {
  width: 64px;
  height: 64px;
  color: var(--cok);
}

.success-title {
  font-family: var(--fu);
  font-size: 22px;
  font-weight: 700;
  color: var(--ct);
}

.success-text {
  font-family: var(--fb);
  font-size: 15px;
  color: var(--ct2);
  line-height: 1.65;
  max-width: 48ch;
}

.success-text--sm {
  font-family: var(--fb);
  font-size: 13.5px;
  color: var(--ct3);
  line-height: 1.6;
  max-width: 44ch;
}

.nro,
.code {
  font-family: var(--fu);
  font-size: 26px;
  font-weight: 700;
  color: var(--cp-dk);
  letter-spacing: 0.06em;
  background: oklch(from var(--cp) l c h / 0.08);
  border: 1.5px solid oklch(from var(--cp) l c h / 0.22);
  border-radius: 10px;
  padding: 10px 28px;
}

/* ─── Warning box ────────────────────────────────────────────────────────── */
.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: oklch(from var(--cp-lt) l c h / 0.14);
  border: 1px solid oklch(from var(--cp-lt) l c h / 0.4);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  max-width: 48ch;
}

.warning-box p {
  font-family: var(--fb);
  font-size: 13.5px;
  color: var(--ct);
  line-height: 1.6;
}

/* ─── Next steps ─────────────────────────────────────────────────────────── */
.next-steps {
  background: var(--cbg);
  border: 1px solid var(--cbrd);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
  max-width: 46ch;
  width: 100%;
}

.next-steps-title {
  font-family: var(--fu);
  font-size: 13px;
  font-weight: 700;
  color: var(--ct);
  margin-bottom: 10px;
}

.next-steps-list {
  font-family: var(--fb);
  font-size: 13.5px;
  color: var(--ct2);
  line-height: 1.7;
  padding-left: 20px;
}

.next-steps-list li + li { margin-top: 4px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .main-card {
    padding: 24px 20px;
    border-radius: 12px;
  }

  .form-grid-2 { grid-template-columns: 1fr; }

  .decree-grid { grid-template-columns: 1fr 1fr; }

  .input--narrow { max-width: 100%; }

  .search-section { padding: 20px 12px 60px; }
}

@media (max-width: 400px) {
  .main-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

/* ─── CES Survey (pantalla de confirmación) ──────────────────────────── */
.ces-survey {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--cbrd);
}

.ces-question {
  font-family: var(--fu);
  font-size: 16px;
  font-weight: 600;
  color: var(--ct);
  margin-bottom: 6px;
}

.ces-sub {
  font-family: var(--fb);
  font-size: 14px;
  color: var(--ct3);
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 52ch;
}

.ces-options {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  transition: opacity 0.25s ease;
}

.ces-options.fading {
  opacity: 0;
  pointer-events: none;
}

.ces-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 10px;
  background: none;
  border: 1.5px solid var(--cbrd);
  border-radius: 10px;
  cursor: pointer;
  min-width: 72px;
  flex: 1;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.ces-opt:hover {
  background: var(--cmuted);
  border-color: var(--cbrd2);
  transform: translateY(-2px);
}

.ces-emoji {
  font-size: 26px;
  line-height: 1;
}

.ces-label {
  font-family: var(--fu);
  font-size: 11px;
  font-weight: 600;
  color: var(--ct3);
  text-align: center;
  line-height: 1.3;
}

.ces-thanks {
  padding: 4px 0;
}

.ces-thanks-msg {
  font-family: var(--fu);
  font-size: 15px;
  font-weight: 500;
  color: var(--cok);
}

/* ─── solicitar_busqueda — reemplazos de inline styles ──────────────── */

/* Tamaño SVG de los botones de intención */
.intention-btn .icon svg { width: 22px; height: 22px; }

/* Estado inicial de la barra de progreso (JS sobreescribe dinámicamente) */
#progressFill { width: 33%; }

/* Margen del botón "Continuar →" (Paso 2) */
#btnStep2Continue { margin-top: 1.25rem; }

/* CTA "Volver al Buscador" en pantalla de éxito */
.btn-volver-buscador { margin-top: 1.5rem; }

/* Contador de caracteres del textarea */
.input-counter {
  display: block;
  font-family: var(--fu);
  font-size: 11px;
  color: var(--ct3);
  text-align: right;
  margin-top: 4px;
  transition: color 0.2s;
}
.input-counter--warn { color: var(--cwarn); }

/* ─── solicitar_copia — reemplazos de inline styles ─────────────────── */

/* Spinner centrado con margen inferior */
.spinner--centered { margin: 0 auto 0.75rem; }

/* Enlace dentro de bloques de alerta de error */
.alert-link {
  font-weight: 700;
  color: var(--cerr);
  text-decoration: underline;
}
.alert-link:hover { color: var(--cerr); opacity: 0.8; }

/* Wrapper del extracto del decreto */
.decree-extracto { margin-top: 0.75rem; }

/* Textarea que permite resize vertical por el usuario */
.textarea--resizable { resize: vertical; }
