:root {
  --primary: #ff4d8f;
  --secondary: #ff69b4;
  --accent: #ff1493;
  --danger: #ff1744;
  --bg: linear-gradient(135deg, #ff6b9d 0%, #c44569 25%, #ff9a8b 50%, #fecfef 100%);
  --glass: rgba(255, 77, 143, 0.18);
  --glass-border: rgba(255, 105, 180, 0.35);
  --text-light: rgba(255,255,255,0.98);
  --text-dark: rgba(255,255,255,0.8);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
  height: 100vh; 
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; 
  background: var(--bg);
  overflow-x: hidden;
  position: relative;
  color: var(--text-light);
  touch-action: manipulation; /* Mejor touch móvil */
}

.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.heart {
  position: absolute;
  font-size: 18px;
  animation: float 5s linear infinite;
}

@keyframes float {
  0% { transform: translateY(100vh) rotate(0deg) scale(0.8); opacity: 0.7; }
  50% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg) scale(1.2); opacity: 0; }
}

/* LOGIN MÓVIL */
.login-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  backdrop-filter: blur(25px);
  background: var(--glass);
  border: 2px solid var(--glass-border);
  border-radius: 28px;
  padding: 40px 28px;
  max-width: 360px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 30px 80px rgba(255,20,147,0.35);
  margin: 10px;
}

h1 { 
  background: linear-gradient(135deg, #ffffff, var(--secondary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  margin-bottom: 16px; 
  font-weight: 800;
}

.subtitle {
  font-size: clamp(1rem, 4vw, 1.15rem);
  opacity: 0.92;
  margin-bottom: 32px;
  color: var(--text-light);
}

label { 
  display: block; 
  margin: 10px 0 10px; 
  color: var(--text-light); 
  font-weight: 600;
  text-align: left;
  font-size: clamp(0.9rem, 3.5vw, 1rem);
}

input { 
  width: 100%; 
  padding: 18px 24px; 
  border: 2px solid var(--glass-border); 
  border-radius: 20px; 
  font-size: clamp(1rem, 4vw, 1.05rem);
  background: rgba(255,255,255,0.12);
  color: var(--text-light);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  margin-bottom: 8px;
}

input::placeholder { color: rgba(255,255,255,0.65); }

input:focus {
  border-color: var(--secondary);
  background: rgba(255,255,255,0.22);
  box-shadow: 0 0 0 4px rgba(255,77,143,0.3);
  transform: translateY(-1px);
}

button {
  width: 100%;
  padding: 20px 28px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
  border-radius: 22px;
  font-size: clamp(1.1rem, 4.5vw, 1.2rem);
  font-weight: 700;
  cursor: pointer;
  margin-top: 24px;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 12px 35px rgba(255,77,143,0.5);
}

button:active { transform: scale(0.98); }

.error, .success { 
  margin-top: 20px; 
  padding: 16px 20px; 
  border-radius: 16px; 
  font-weight: 600; 
  animation: slideIn 0.4s ease;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.25);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* PREGUNTA MÓVIL */
.content {
  min-height: 100vh;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
}

.buttons {
  display: flex;
  gap: 20px;
  max-width: 100%;
  width: 100%;
  margin: 40px 0;
}

.big-btn {
  flex: 1;
  padding: 24px 20px !important;
  font-size: clamp(1.15rem, 5vw, 1.3rem) !important;
  border-radius: 24px !important;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-si { 
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  box-shadow: 0 15px 45px rgba(255,77,143,0.55) !important;
}

.btn-no { 
  background: rgba(255,23,68,0.25) !important; 
  color: var(--text-light) !important; 
  backdrop-filter: blur(15px) !important;
  border: 2px solid rgba(255,23,68,0.5) !important;
  animation: shake 0.6s infinite !important;
}

@keyframes shake { 
  0%, 100% { transform: translateX(0); } 
  25% { transform: translateX(-6px); } 
  75% { transform: translateX(6px); } 
}

.btn-cita {
  background: linear-gradient(135deg, var(--danger), var(--primary)) !important;
  color: white !important;
  padding: 24px 48px !important;
  font-size: clamp(1.1rem, 4.5vw, 1.25rem) !important;
  font-weight: 800 !important;
  border-radius: 50px !important;
  box-shadow: 0 20px 60px rgba(255,23,68,0.55) !important;
  animation: pulse 2s infinite !important;
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  min-width: 280px;
  max-width: 90vw;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 20px 60px rgba(255,23,68,0.55); }
  50% { box-shadow: 0 25px 70px rgba(255,23,68,0.75); transform: scale(1.02); }
}

.message { 
  margin-top: 32px; 
  font-size: clamp(1.2rem, 5vw, 1.4rem); 
  font-weight: 700; 
  max-width: 90%;
  opacity: 0; 
  transform: translateY(20px);
  transition: all 0.6s ease;
}
.message.show { opacity: 1; transform: translateY(0); }

/* LOADING POWERPUFF MÓVIL */
.loading-full { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.powerpuff-loading { width: 140px; height: 140px; position: relative; }
.powerpuff-ring {
  position: absolute; top: 50%; left: 50%; width: 120px; height: 120px;
  border: 4px solid transparent; border-top: 4px solid var(--accent); border-right: 4px solid var(--primary);
  border-radius: 50%; transform: translate(-50%, -50%);
  animation: powerpuffSpin 1.2s cubic-bezier(0.5,0,0.5,1) infinite;
  box-shadow: 0 0 25px var(--primary);
}
.powerpuff-glow {
  position: absolute; top: 50%; left: 50%; width: 80px; height: 80px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); border-radius: 50%;
  transform: translate(-50%, -50%); animation: powerpuffPulse 1.5s ease-in-out infinite alternate;
  filter: blur(6px);
}
.powerpuff-sparkles { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 20px; animation: sparkle 2s ease-in-out infinite; }
.powerpuff-sparkles span { position: absolute; animation: sparkleFloat 2s ease-in-out infinite; }
.powerpuff-sparkles span:nth-child(1) { animation-delay: 0s; }
.powerpuff-sparkles span:nth-child(2) { animation-delay: 0.5s; left: 15px; }
.powerpuff-sparkles span:nth-child(3) { animation-delay: 1s; top: -15px; }
.powerpuff-sparkles span:nth-child(4) { animation-delay: 1.5s; right: 15px; }

@keyframes powerpuffSpin { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes powerpuffPulse { 0% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; } 100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0.3; } }
@keyframes sparkleFloat { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(6px, -6px); } }

/* MÓVIL SAFE AREA */
@supports (padding: max(0px)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .btn-cita { bottom: calc(40px + env(safe-area-inset-bottom)); }
}
/* FIX MÓVIL DEFINITIVO */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  position: relative;
  z-index: 10;
}

.login-card {
  max-width: 100%;
  max-height: 85vh;
  width: 100%;
  max-width: 380px;
  padding: 32px 24px;
  margin: 0 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Scroll suave iOS */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.login-card::-webkit-scrollbar { display: none; } /* Chrome/Safari */

@media (max-height: 650px) {
  .login-container { padding: 10px 0; }
  .login-card { padding: 24px 20px; margin: 8px auto; max-height: 90vh; }
}

@media (max-width: 400px) {
  .login-card { padding: 28px 20px; }
  h1 { font-size: 2rem !important; }
}
/* FIX date input iOS/Safari - NO SE SALE */
input[type="date"] {
  /* Forzar comportamiento nativo controlado */
  font-size: 16px !important; /* Previene zoom iOS */
  height: 56px; /* Altura fija */
  padding: 12px 20px !important; /* Menos padding vertical */
  line-height: 1.4;
  appearance: none;
  -webkit-appearance: none;
}

/* Container específico para date */
.date-wrapper {
  position: relative;
  margin-bottom: 20px;
}

/* iOS Safari específico */
@supports (-webkit-appearance: none) {
  input[type="date"] {
    padding: 14px 20px !important;
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
  }
}

/* Media query para pantallas muy pequeñas */
@media (max-height: 500px) {
  input[type="date"] {
    font-size: 15px !important;
    padding: 10px 18px !important;
    height: 48px !important;
  }
  .login-card {
    padding: 20px 18px !important;
    margin: 4px !important;
  }
}
