/* ==========================================================================
   ESTILOS PERSONALIZADOS - RENDICIÓN DE CUENTAS PARTICIPATIVA
   Alcaldía de Bello - "Hechos con el Corazón"
   Bootstrap 5.3+ Enhancement
   ========================================================================== */

:root {
  --primary-purple: #5c1b82;
  --primary-purple-dark: #431260;
  --primary-purple-light: #7b29ad;
  --secondary-teal: #008f9c;
  --secondary-blue: #0070ba;
  --accent-orange: #f26822;
  --accent-yellow: #f5a623;
  --accent-pink: #d92d77;
  
  --bg-gradient-start: #f8f6fc;
  --bg-gradient-end: #eef2f8;
  --card-bg: #ffffff;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --radius-lg: 1.25rem;
  --radius-md: 0.85rem;
  --shadow-sm: 0 4px 12px rgba(92, 27, 130, 0.05);
  --shadow-md: 0 10px 30px rgba(92, 27, 130, 0.08);
  --shadow-lg: 0 20px 45px rgba(92, 27, 130, 0.12);
  --shadow-hover: 0 15px 35px rgba(92, 27, 130, 0.16);
}

/* Base styling */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Institutional top bar */
.top-institutional-bar {
  background: linear-gradient(90deg, #40105c 0%, #5c1b82 50%, #0070ba 100%);
  color: #ffffff;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}

.top-institutional-bar a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.top-institutional-bar a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* Header Banner Container */
.header-banner-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  background-color: #ffffff;
  border: 1px solid rgba(92, 27, 130, 0.1);
}

.header-banner-img {
  width: 100%;
  height: 100%;
  max-height: 900px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.4s ease;
}

/* Ribbon accent badge */
.cinta-decorativa {
  position: absolute;
  top: 15px;
  right: -10px;
  max-width: 180px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15));
  z-index: 2;
}

/* Decorative subtle heart floaters */
.floating-heart {
  position: absolute;
  width: 44px;
  height: auto;
  opacity: 0.85;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
  animation: floatSlow 4s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 3;
}

.floating-heart-1 {
  bottom: 15px;
  left: 20px;
  animation-delay: 0s;
}

.floating-heart-2 {
  top: 20px;
  left: 15px;
  width: 36px;
  animation-delay: 1.5s;
}

@keyframes floatSlow {
  0% { transform: translateY(0px) rotate(-3deg); }
  100% { transform: translateY(-10px) rotate(4deg); }
}

/* Main Form Card */
.form-main-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  padding: 2.25rem 2rem;
  margin-bottom: 2.5rem;
  position: relative;
}

@media (max-width: 576px) {
  .form-main-card {
    padding: 1.5rem 1rem;
    border-radius: 1rem;
  }
}

/* Section Divider Headers */
.form-section-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-bottom: 0.85rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #f1f5f9;
  position: relative;
}

.form-section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 65px;
  height: 2px;
  background: var(--primary-purple);
  border-radius: 2px;
}

.form-section-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5f0fa;
  flex-shrink: 0;
}

.form-section-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.form-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-purple-dark);
  margin: 0;
}

.form-section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Modern Input Controls */
.form-label {
  font-weight: 600;
  font-size: 0.92rem;
  color: #334155;
  margin-bottom: 0.45rem;
}

.form-label .required-star {
  color: #dc2626;
  margin-left: 2px;
}

.form-control, .form-select {
  border-radius: var(--radius-md);
  border: 1.5px solid #cbd5e1;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--text-dark);
  transition: all 0.2s ease;
  min-height: 48px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 4px rgba(92, 27, 130, 0.12);
  outline: none;
}

.form-control::placeholder {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* Input group with icon */
.input-group-custom .input-group-text {
  background-color: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: #64748b;
  font-size: 1.1rem;
  min-width: 46px;
  justify-content: center;
}

.input-group-custom .form-control,
.input-group-custom .form-select {
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.input-group-custom:focus-within .input-group-text {
  border-color: var(--primary-purple);
  color: var(--primary-purple);
}

/* Radio Cards (for Género and Edad) */
.radio-card-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.radio-card-item {
  flex: 1 1 calc(33.333% - 0.65rem);
  min-width: 130px;
}

@media (max-width: 768px) {
  .radio-card-item {
    flex: 1 1 calc(50% - 0.65rem);
  }
}

.radio-card-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  color: #475569;
  transition: all 0.2s ease;
  min-height: 48px;
  text-align: center;
  user-select: none;
  width: 100%;
}

.radio-card-label:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.radio-card-input:checked + .radio-card-label {
  background-color: #f3ebf9;
  border-color: var(--primary-purple);
  color: var(--primary-purple-dark);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(92, 27, 130, 0.15);
}

.radio-card-input:focus-visible + .radio-card-label {
  box-shadow: 0 0 0 3px rgba(92, 27, 130, 0.25);
}

/* Population Groups - Grid of interactive cards */
.population-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

@media (max-width: 576px) {
  .population-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.population-checkbox-card {
  position: relative;
}

.population-checkbox-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.population-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: #334155;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 52px;
  user-select: none;
  height: 100%;
}

.population-checkbox-label:hover {
  border-color: #94a3b8;
  background-color: #f8fafc;
}

.population-checkbox-label .check-indicator {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  transition: all 0.2s ease;
  flex-shrink: 0;
  color: #ffffff;
  font-size: 0.75rem;
}

.population-checkbox-input:checked + .population-checkbox-label {
  border-color: var(--primary-purple);
  background-color: #faf5ff;
  color: var(--primary-purple-dark);
  font-weight: 600;
}

.population-checkbox-input:checked + .population-checkbox-label .check-indicator {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
}

/* Data Protection Section */
.terms-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.55;
}

.terms-checkbox-wrapper {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: border-color 0.2s ease;
}

.terms-checkbox-wrapper:hover {
  border-color: var(--primary-purple);
}

.terms-checkbox-wrapper .form-check-input {
  width: 1.35em;
  height: 1.35em;
  border-radius: 4px;
  margin-top: 0.15em;
  cursor: pointer;
}

.terms-checkbox-wrapper .form-check-input:checked {
  background-color: var(--primary-purple);
  border-color: var(--primary-purple);
}

/* Submit Button */
.btn-submit-registration {
  background: linear-gradient(135deg, var(--primary-purple) 0%, #7b29ad 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.95rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(92, 27, 130, 0.25);
  transition: all 0.25s ease;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
}

.btn-submit-registration:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(92, 27, 130, 0.35);
  background: linear-gradient(135deg, #4d156d 0%, #6c2298 100%);
  color: #ffffff;
}

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

.btn-submit-registration:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Security assurance badges container */
.security-assurances {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1rem;
  background-color: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: #64748b;
}

.security-badge-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.security-badge-item i {
  color: #10b981;
  font-size: 1rem;
}

/* Secondary info card with banner 2 */
.secondary-info-card {
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.secondary-banner-img {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

/* Institutional Footer */
.footer-institutional {
  background-color: #1e112a;
  color: #e2e8f0;
  padding: 3rem 1rem 1.5rem;
  margin-top: auto;
  font-size: 0.88rem;
}

.footer-institutional a {
  color: #cbd5e1;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-institutional a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 1rem;
}

/* Receipt voucher modal styling */
.voucher-receipt-card {
  border: 2px dashed #cbd5e1;
  background: #fafafa;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
}

.voucher-barcode {
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 4px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-purple);
  text-align: center;
  padding: 0.5rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

/* Honeypot anti-bot hidden field */
.security-bot-trap {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  height: 0;
  width: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* Print voucher styles */
@media print {
  body * {
    visibility: hidden;
  }
  #voucherPrintArea, #voucherPrintArea * {
    visibility: visible;
  }
  #voucherPrintArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 20px;
  }
}

