/* ============================================
   ICU MedNet - Fondo único (hero+card) desde SVG
   ============================================ */

:root {
  --navy-dark: #000310;
  --blue-accent: #0994d3;
  --blue-glow: #17b1ff;
  --text-white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  background-color: var(--navy-dark);
  color: var(--text-white);
  position: relative;
  min-height: 100vh;
  display: flex;
}

/* Canvas de partículas: fijo, detrás de todo el contenido */
#particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; 
  pointer-events: none;
  display: block;
}

.site-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1920px;
  margin: auto;   
  background: transparent;
}

/* ---------- Fondo único: hero + card en una sola imagen ---------- */
.page-graphic-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 0 20px 60px;
  box-sizing: border-box;
  background: transparent;
}

.page-graphic {
  position: relative;
  width: 100%;
  max-width: 900px;          
  margin: 0 auto;
  aspect-ratio: 784.16 / 1028.94;
  background-image: url('../img/formulario.svg');
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 100%;
}

/* ---------- Formulario: inputs reales posicionados ---------- */
form {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.field { position: absolute; margin: 0; }

/* Nombre */
.field:has(#nombre) {
  left: 17.5%; right: 17.6%;
  top: 71.0%; height: 3.43%;
}
/* Institución */
.field:has(#institucion) {
  left: 17.5%; right: 17.6%;
  top: 76.5%; height: 3.57%;
}

.field-row {
  position: absolute;
  left: 0; right: 0;
  top: 82.3%; height: 3.58%;
}
.field-row .field { position: absolute; top: 0; height: 100%; margin: 0; }
/* Correo */
.field-row .field:has(#correo)   { left: 17.5%;  right: 51.0%; }
/* Teléfono */
.field-row .field:has(#telefono) { left: 51.4%;  right: 17.6%; }

label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

input {
  width: 100%;
  height: 100%;
  padding: 0 1.8%;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(11px, 1.6vw, 14px);
  color: var(--text-white);
  background: transparent;   
  border: none;
  outline: none;
}
input::placeholder { color: rgba(255,255,255,0.35); }
input:focus { background: rgba(23,177,255,0.10); border-radius: 30px; }

.form-message {
  position: absolute;
  left: 17.5%; right: 17.6%;
  top: 92.5%;
  font-size: 12px;
  text-align: center;
  color: #ff8080;
}
.form-message.success { color: #37e08c; }

/* Botón: transparente */
button#submitBtn {
  position: absolute;
  left: 17.5%; right: 17.6%;
  top: 88.3%; height: 3.69%;
  background: transparent;
  border: none;
  color: transparent;   
  cursor: pointer;
}
button#submitBtn:disabled { cursor: not-allowed; }

/* ---------- Ventana Emergente Completa (Overlay) ---------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 3, 16, 0.82); 
  backdrop-filter: blur(10px);       
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-content {
  text-align: center;
  width: 100%;
  padding: 20px;
  transition: all 0.3s ease;
}

.overlay-content.hidden {
  display: none !important;
}

/* Spinner de carga */
.medical-spinner {
  width: 55px;
  height: 55px;
  border: 3px solid rgba(23, 177, 255, 0.1);
  border-top-color: var(--blue-glow);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(23, 177, 255, 0.3);
}

.overlay-content p {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--text-white);
  margin: 0 0 6px 0;
  letter-spacing: 0.5px;
}

.overlay-content span {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

/* --- Icono de éxito interactivo --- */
.success-checkmark {
  width: 65px;
  height: 65px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid #37e08c;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(55, 224, 140, 0.3);
  animation: scaleUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.check-icon {
  width: 14px;
  height: 26px;
  border: solid #37e08c;
  border-width: 0 3px 3px 0;
  transform: rotate(45px);
  margin-top: -4px;
  animation: drawCheck 0.3s ease-in-out 0.3s forwards;
  opacity: 0;
}

.success-title {
  color: #37e08c !important;
}

/* Animaciones de interfaz */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scaleUp { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drawCheck { 
  from { opacity: 0; transform: scale(0.5) rotate(45deg); } 
  to { opacity: 1; transform: scale(1) rotate(45deg); } 
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) { .page-graphic-wrap { padding: 0 16px 50px; } }
@media (max-width: 640px) { .page-graphic-wrap { padding: 0 12px 40px; } input { padding: 0 2.5%; } }
@media (max-width: 480px) { .page-graphic-wrap { padding: 0 8px 32px; input { padding: 0 3%; font-size: clamp(9px, 3vw, 13px); } } }
@media (max-width: 360px) { .page-graphic-wrap { padding: 0 6px 28px; } }