/* =========================================================
   ESTILOS INSTITUCIONALES - CIRCULEMOS CHÍA
   Formulario de Registro de Preguntas y Solicitudes
   ========================================================= */

:root {
  --primary-color: #0b3a60;
  --primary-hover: #072a47;
  --primary-light: #e8f1fa;
  --header-bg: #dcebfc;
  --accent-teal: #009988;
  --accent-green: #2e7d32;
  --accent-blue: #0070ba;
  --bg-gradient-start: #edf4fc;
  --bg-gradient-end: #dceaf7;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #556980;
  --border-color: #bcd5eb;
  --border-focus: #0070ba;
  --shadow-sm: 0 2px 8px rgba(11, 58, 96, 0.05);
  --shadow-md: 0 10px 30px rgba(11, 58, 96, 0.09);
  --shadow-lg: 0 20px 50px rgba(11, 58, 96, 0.14);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Marca de agua de fondo idéntica al modelo */
.bg-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(8rem, 22vw, 24rem);
  font-weight: 800;
  color: rgba(11, 58, 96, 0.04);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  white-space: nowrap;
  letter-spacing: -0.05em;
  font-family: 'Times New Roman', serif;
}

/* Barra superior de navegación y utilidades */
.top-nav {
  position: relative;
  z-index: 10;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid rgba(188, 213, 235, 0.6);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
}

.brand-badge .dot {
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.btn-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.btn-nav-action:hover {
  background: var(--primary-light);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

/* Contenedor principal */
.main-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto 40px auto;
  padding: 0 16px;
}

/* Header central con logo */
.brand-header-center {
  text-align: center;
  margin-bottom: 24px;
}

.main-logo-img {
  max-width: 260px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(11, 58, 96, 0.08));
  transition: transform 0.3s ease;
}

.main-logo-img:hover {
  transform: scale(1.02);
}

/* Tarjeta del Formulario */
.form-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(188, 213, 235, 0.5);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.form-card:hover {
  box-shadow: var(--shadow-lg);
}

/* Cabecera azul suave de la tarjeta (según imagen modelo) */
.card-header-banner {
  background: var(--header-bg);
  padding: 30px 24px;
  text-align: center;
  border-bottom: 1px solid rgba(188, 213, 235, 0.6);
}

.card-title {
  color: var(--primary-color);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.card-subtitle {
  color: var(--text-muted);
  font-size: 0.98rem;
  font-weight: 500;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.45;
}

/* Cuerpo del formulario */
.card-body {
  padding: 32px 36px;
}

@media (max-width: 600px) {
  .card-body {
    padding: 24px 18px;
  }
}

/* Secciones y grupos de formulario */
.form-section {
  margin-bottom: 26px;
}

.section-title-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 18px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 680px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .required-star {
  color: #e53e3e;
  margin-left: 3px;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #7b94ad;
  pointer-events: none;
  transition: color 0.2s ease;
}

.form-control {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-dark);
  background-color: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.form-control.no-icon {
  padding-left: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px rgba(0, 112, 186, 0.15);
  background-color: #fff;
}

.form-control:focus + svg,
.input-icon-wrapper:focus-within svg {
  color: var(--accent-blue);
}

.form-control::placeholder {
  color: #94a3b8;
}

.form-control[readonly] {
  background-color: #f8fafc;
  cursor: default;
}

/* Placa con formato mayúsculas */
input#numeroPlaca {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* Campo principal destacado de Pregunta / Solicitud */
.highlight-prompt-box {
  background: #f0f7ff;
  border: 1.5px solid #b2d7ff;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}

.highlight-prompt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.highlight-icon-badge {
  background: var(--primary-color);
  color: #ffffff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
}

.highlight-prompt-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.textarea-control {
  width: 100%;
  min-height: 130px;
  padding: 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-dark);
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  resize: vertical;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.textarea-control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3.5px rgba(0, 112, 186, 0.15);
}

.char-counter {
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Zona de Carga de Archivos e Imágenes */
.dropzone-container {
  border: 2px dashed #99c2e8;
  border-radius: var(--radius-md);
  background: #fbfdff;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dropzone-container:hover,
.dropzone-container.dragover {
  background: #f0f7ff;
  border-color: var(--accent-blue);
  transform: translateY(-2px);
}

.dropzone-icon {
  width: 44px;
  height: 44px;
  color: var(--accent-blue);
  margin-bottom: 8px;
}

.dropzone-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-input-hidden {
  display: none;
}

.files-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.file-item-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name {
  font-weight: 600;
  color: var(--text-dark);
}

.file-size {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.btn-remove-file {
  background: none;
  border: none;
  color: #e53e3e;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.btn-remove-file:hover {
  background: #fee2e2;
}

/* Sección de Tratamiento de Datos / Habeas Data */
.habeas-data-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 26px;
}

.consent-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.consent-checkbox-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--primary-color);
  cursor: pointer;
  flex-shrink: 0;
}

.consent-text {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #334155;
  font-weight: 500;
}

.btn-toggle-terms {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0 0 32px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-toggle-terms:hover {
  text-decoration: underline;
}

.full-terms-box {
  margin-top: 12px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #64748b;
  max-height: 140px;
  overflow-y: auto;
  display: none;
}

.full-terms-box.active {
  display: block;
}

/* Botón principal de envío */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #063155 100%);
  color: #ffffff;
  border: none;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(11, 58, 96, 0.25);
}

.btn-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #0d4675 0%, #073860 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(11, 58, 96, 0.35);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

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

/* Pantalla de Éxito / Confirmación */
.success-card {
  display: none;
  text-align: center;
  padding: 40px 24px;
}

.success-icon-wrapper {
  width: 72px;
  height: 72px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.2);
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  color: var(--primary-color);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.success-message {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.radicado-badge {
  background: #f0f7ff;
  border: 1.5px dashed var(--accent-blue);
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin-bottom: 24px;
}

.radicado-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.radicado-number {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 0.05em;
  font-family: monospace;
}

.success-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-secondary {
  background: #ffffff;
  color: var(--primary-color);
  border: 1.5px solid var(--border-color);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  background: var(--primary-light);
  border-color: var(--accent-blue);
}

/* Modal del Código QR */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 58, 96, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 440px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-dark);
}

.qr-image-wrapper {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: inline-block;
  margin: 16px 0;
}

.qr-image-wrapper img {
  max-width: 240px;
  width: 100%;
  height: auto;
  display: block;
}

.qr-url-box {
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--primary-color);
  font-weight: 600;
  word-break: break-all;
  margin-bottom: 16px;
}

/* Footer institucional */
.footer-main {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer-main a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
}
