/* ============================
   FORMULARIOS (ESTILO PRO + UI VALIDATIONS)
   ============================ */

/* Reset y base */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  background: #ece9f3;
}

/* ==========================================================
   UI POLISH 2026 - Formularios publicos
   Mantiene la paleta municipal y unifica controles.
   ========================================================== */

:root {
  --form-accent: #e72285;
  --form-accent-strong: #470c9d;
  --form-surface: #ffffff;
  --form-soft: #fbf8ff;
  --form-text: #2f2342;
  --form-muted: #665f77;
  --form-border: rgba(71, 12, 157, 0.16);
  --form-radius: 10px;
  --form-shadow: 0 18px 44px rgba(67, 38, 132, 0.12);
}

body {
  color: var(--form-text);
  background:
    radial-gradient(rgba(231, 34, 133, 0.08) 2px, transparent 2px),
    radial-gradient(rgba(71, 12, 157, 0.08) 2px, transparent 2px),
    #ece9f3;
  background-size: 44px 44px, 44px 44px, auto;
  background-position: 0 0, 22px 22px, 0 0;
}

.form-shell {
  max-width: 860px;
  padding: 0 18px 34px;
}

.form-bar {
  min-height: 132px;
  padding: 32px 28px;
  border-radius: var(--form-radius);
  box-shadow: var(--form-shadow);
}

.form-bar img {
  height: 70px;
}

.form-bar h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  letter-spacing: 0;
}

.secretaria-form {
  max-width: 820px;
  padding: 22px 0 10px;
}

.secretaria-header {
  border-radius: var(--form-radius) var(--form-radius) 0 0;
  border-color: var(--form-border);
  background: linear-gradient(180deg, #ffffff, var(--form-soft));
  box-shadow: 0 10px 24px rgba(67, 38, 132, 0.08);
}

.secretaria-header::before {
  height: 5px;
  background: linear-gradient(90deg, var(--form-accent), var(--form-accent-strong));
}

.secretaria-header h3 {
  color: var(--form-text);
  letter-spacing: 0;
}

.secretaria-header p {
  color: var(--form-muted);
}

.secretaria-form form {
  border-color: var(--form-border);
  border-radius: 0 0 var(--form-radius) var(--form-radius);
  box-shadow: 0 18px 40px rgba(67, 38, 132, 0.10);
}

.secretaria-form .form-grid {
  gap: 16px;
}

.secretaria-form form .form-grid > label,
.secretaria-form form > label,
.radio-label-title,
.label-title {
  color: var(--form-text);
  letter-spacing: 0;
}

.secretaria-form input,
.secretaria-form select,
.secretaria-form textarea {
  border-radius: 8px;
  border-color: rgba(71, 12, 157, 0.18);
  background: #fff;
  color: var(--form-text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.9);
}

.secretaria-form input:hover,
.secretaria-form select:hover,
.secretaria-form textarea:hover {
  border-color: rgba(71, 12, 157, 0.28);
}

.secretaria-form input:focus,
.secretaria-form select:focus,
.secretaria-form textarea:focus {
  border-color: rgba(231, 34, 133, 0.58);
  box-shadow: 0 0 0 4px rgba(231, 34, 133, 0.12);
}

.radio-stack,
.radio-group,
.checkbox-group,
.checkbox-list {
  border-color: var(--form-border);
  border-radius: var(--form-radius);
  background: linear-gradient(180deg, #ffffff, #fcf9ff);
}

.radio-stack label,
.radio-group label,
.checkbox-group label,
.checkbox-item {
  border-radius: 8px;
}

.radio-stack label:hover,
.radio-group label:hover,
.checkbox-group label:hover,
.checkbox-item:hover {
  background: rgba(231, 34, 133, 0.055);
}

.btn-primary,
.btn-secondary {
  min-height: 42px;
  border-radius: 8px;
  letter-spacing: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--form-accent), var(--form-accent-strong));
  box-shadow: 0 10px 22px rgba(71, 12, 157, 0.20);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(71, 12, 157, 0.26);
}

.btn-secondary {
  border: 1px solid var(--form-border);
  background: #fff;
  color: var(--form-accent-strong);
}

.field-error,
.form-feedback {
  border-radius: 8px;
}

.form-footer {
  color: var(--form-muted);
}

@media (max-width: 640px) {
  .form-shell {
    margin-top: 18px;
    padding-inline: 12px;
  }

  .form-bar {
    padding: 26px 18px;
    flex-direction: column;
    text-align: center;
  }

  .secretaria-header,
  .secretaria-form form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .step-actions {
    flex-direction: column;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
}

/* Contenedor principal */
.form-shell {
  max-width: 780px;
  margin: 32px auto 40px;
  padding: 0 10px 24px;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Header */
.form-bar {
  background: linear-gradient(90deg, rgba(231,34,133,1) 0%, rgba(71,12,157,1) 70%);
  color: #fff;
  padding: 52px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.form-bar img { height: 64px; width: auto; }
.form-hero-img {
  height: 68px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
.section-hero-img {
  display: block;
  max-width: 340px;
  width: 90%;
  height: auto;
  margin: 12px auto 0;
  object-fit: contain;
}
#medioambienteLogoDenuncia,
#medioambienteLogoResiduos,
#discapacidadLogo {
  max-width: 380px;
  width: 100%;
}

.form-bar h2 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

/* Bloque formulario */
.secretaria-form {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 20px 10px;
  background: transparent;
  border-radius: 12px;
}

/* Encabezado interno */
.secretaria-header {
  background: #f8f9fb;
  border-radius: 12px 12px 0 0;
  border: 1px solid #e8eaed;
  padding: 22px 24px 18px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  position: relative;
  text-align: center;
}

.secretaria-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  border-radius: 12px 12px 0 0;
  background: #673ab7;
}

.secretaria-header h3 {
  margin: 12px 0 6px 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #202124;
}

.secretaria-header p {
  margin: 0;
  color: #5f6368;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Form */
.secretaria-form form {
  background: #ffffff;
  border: 1px solid #e8eaed;
  border-top: none;
  padding: 22px 24px 22px;
  border-radius: 0 0 12px 12px;
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 16px;
  border: 1px solid #e3e6f2;
  border-radius: 12px;
  background: #ffffff;
  align-items: flex-start;
  text-align: left;
}

.secretaria-form .radio-group label,
.secretaria-form .checkbox-list .checkbox-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

.secretaria-form .radio-group {
  align-items: flex-start !important;
}

.checkbox-card {
  display: block;
}

.checkbox-list {
  margin-top: 8px;
  padding: 16px 18px;
  border: 1px solid #e3e6f2;
  border-radius: 12px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
  box-shadow: 0 6px 14px rgba(20, 16, 40, 0.04);
  text-align: left;
}

.checkbox-item {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100%;
  font-size: 0.96rem;
  color: #2f2a45;
  font-weight: 500 !important;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #673ab7;
  margin: 0;
}

.checkbox-other {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.checkbox-other input[type="text"] {
  margin: 0;
  height: 42px;
  width: 100%;
}

.checkbox-inline {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-weight: 500 !important;
  margin: 0 !important;
}

.radio-group label,
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.96rem;
  color: #2f2a45;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.radio-group input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #673ab7;
}

/* GRID: SIEMPRE 1 COLUMNA (uno debajo del otro) */
.secretaria-form .form-grid {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 18px;
  max-width: 720px;
  margin: 0 auto;
}

/* Labels */
.secretaria-form form .form-grid > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #202124;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.25;
  margin: 0;
}
.label-title,
.radio-label-title {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  flex-wrap: wrap;
  white-space: normal;
  line-height: 1.35;
}
.required-star {
  display: inline;
  color: #c62828;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
  flex: 0 0 auto;
}
.required-star::before { content: "\00A0"; }

/* Inputs / Select / Textarea */
.secretaria-form input,
.secretaria-form select,
.secretaria-form textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #202124;
  font-size: 0.96rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.secretaria-form input,
.secretaria-form select {
  height: 44px;
}

.secretaria-form textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.45;
}

.secretaria-form input::placeholder,
.secretaria-form textarea::placeholder { color: #9aa0a6; }

.secretaria-form input:focus,
.secretaria-form select:focus,
.secretaria-form textarea:focus {
  border-color: #673ab7;
  box-shadow: 0 0 0 3px rgba(103,58,183,0.15);
  background-color: #fff;
}

/* =========================
   Radios (tipo denunciante / infractor)
   ========================= */
.radio-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start !important;
  margin-top: 6px;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid #e8eaed;
  background: #f8f9fb;
}

.radio-label-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #37474f;
  font-size: 0.95rem;
}

.radio-stack label {
  width: 100%;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  font-weight: 500 !important;
  margin: 0;
  line-height: 1.35;
  color: #37474f;
  font-size: 0.95rem;
  white-space: normal !important;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background-color .18s ease, transform .12s ease;
}

.radio-stack label:hover {
  background: rgba(103,58,183,0.06);
}

.radio-stack input[type="radio"],
.radio-stack input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 !important;
  accent-color: #673ab7;
  flex-shrink: 0;
}

/* Botones */
.step-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.btn-primary,
.btn-secondary {
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.08s ease;
  font-size: 0.93rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.btn-primary { background: #673ab7; color: #ffffff; }
.btn-primary:hover { background: #5e35b1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transform: translateY(-1px); }

.btn-secondary { background: #f1f3f4; color: #1f1f1f; }
.btn-secondary:hover { background: #e4e6e8; }

/* Feedback */
.form-feedback { margin-top: 10px; font-weight: 500; font-size: 0.9rem; }
.form-feedback.sending { color: #c17d00; }
.form-feedback.success { color: #1b8a4a; }
.form-feedback.error { color: #c62828; }

.d-none { display: none !important; }

/* Footer */
.form-footer {
  margin-top: 10px;
  background: linear-gradient(90deg, rgba(231,34,133,1) 0%, rgba(71,12,157,1) 70%);
  color: #fff;
  text-align: center;
  padding: 14px 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.12);
}

/* ============================
   VALIDACIÓN VISUAL + ANIMACIONES
   ============================ */

/* Estado inválido (borde rojo + glow) */
.is-invalid{
  border-color: #d93025 !important;
  box-shadow: 0 0 0 3px rgba(217,48,37,0.16) !important;
}

/* Mensaje error bajo el campo */
.field-error{
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #d93025;
  opacity: 0;
  transform: translateY(-4px);
  animation: fadeDown .18s ease forwards;
}

/* Radios inválidos (borde rojo del bloque) */
.radio-stack.is-invalid{
  border-color: #d93025 !important;
  box-shadow: 0 0 0 3px rgba(217,48,37,0.12) !important;
}

/* Animación suave entrada del mensaje */
@keyframes fadeDown{
  to { opacity: 1; transform: translateY(0); }
}

/* Pequeño “shake” al fallar */
.shake{
  animation: shake .22s ease;
}

@keyframes shake{
  0%{ transform: translateX(0); }
  25%{ transform: translateX(-4px); }
  50%{ transform: translateX(4px); }
  75%{ transform: translateX(-3px); }
  100%{ transform: translateX(0); }
}

/* ============================
   Modo oscuro
   ============================ */
.dark-mode .secretaria-form form { background: #1f2333; border-color: #2f3447; }
.dark-mode .secretaria-form .secretaria-header { background: #1f2333; border-color: #2f3447; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); }
.dark-mode .secretaria-form .secretaria-header::before { background: linear-gradient(90deg, #b86bff 0%, #7c4dff 60%, #5d35b1 100%); }
.dark-mode .secretaria-form .secretaria-header h3 { color: #f8f9fb; }
.dark-mode .secretaria-form .secretaria-header p { color: #d1d5e1; }
.dark-mode .secretaria-form form label { color: #e8eaf1; }

.dark-mode .secretaria-form input,
.dark-mode .secretaria-form select,
.dark-mode .secretaria-form textarea {
  background: #15192b;
  color: #f8f9fb;
  border: 1px solid #3a3f52;
}

.dark-mode .secretaria-form input:focus,
.dark-mode .secretaria-form select:focus,
.dark-mode .secretaria-form textarea:focus {
  border-color: #8ab4f8;
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.18);
}

.dark-mode .radio-stack {
  background: rgba(255,255,255,0.04);
  border-color: #2f3447;
}

.dark-mode .radio-label-title { color: #dfe3f2; }
.dark-mode .radio-stack label { color: #dfe3f2; }

/* UI polish final override */
body {
  color: #2f2342;
  background:
    radial-gradient(rgba(231, 34, 133, 0.08) 2px, transparent 2px),
    radial-gradient(rgba(71, 12, 157, 0.08) 2px, transparent 2px),
    #ece9f3;
  background-size: 44px 44px, 44px 44px, auto;
  background-position: 0 0, 22px 22px, 0 0;
}

.form-shell {
  max-width: 860px !important;
  padding: 0 18px 34px !important;
}

.form-bar {
  min-height: 132px;
  padding: 32px 28px !important;
  border-radius: 10px !important;
  box-shadow: 0 18px 44px rgba(67, 38, 132, 0.12) !important;
}

.secretaria-header {
  border-radius: 10px 10px 0 0 !important;
  border-color: rgba(71, 12, 157, 0.16) !important;
  background: linear-gradient(180deg, #ffffff, #fbf8ff) !important;
  box-shadow: 0 10px 24px rgba(67, 38, 132, 0.08) !important;
}

.secretaria-header::before {
  background: linear-gradient(90deg, #e72285, #470c9d) !important;
}

.secretaria-form form {
  border-color: rgba(71, 12, 157, 0.16) !important;
  border-radius: 0 0 10px 10px !important;
  box-shadow: 0 18px 40px rgba(67, 38, 132, 0.10) !important;
}

.secretaria-form input,
.secretaria-form select,
.secretaria-form textarea {
  border-radius: 8px !important;
  border-color: rgba(71, 12, 157, 0.18) !important;
}

.secretaria-form input:focus,
.secretaria-form select:focus,
.secretaria-form textarea:focus {
  border-color: rgba(231, 34, 133, 0.58) !important;
  box-shadow: 0 0 0 4px rgba(231, 34, 133, 0.12) !important;
}

.radio-stack,
.radio-group,
.checkbox-group,
.checkbox-list {
  border-radius: 10px !important;
  border-color: rgba(71, 12, 157, 0.16) !important;
  background: linear-gradient(180deg, #ffffff, #fcf9ff) !important;
}

.btn-primary {
  border-radius: 8px !important;
  background: linear-gradient(135deg, #e72285, #470c9d) !important;
  box-shadow: 0 10px 22px rgba(71, 12, 157, 0.20) !important;
}

.btn-secondary {
  border-radius: 8px !important;
  border: 1px solid rgba(71, 12, 157, 0.16) !important;
  background: #fff !important;
  color: #470c9d !important;
}

@media (max-width: 640px) {
  .form-bar {
    flex-direction: column;
    text-align: center;
  }

  .step-actions {
    flex-direction: column;
  }
}
