/* =============================================
   AQUA MONITOR – styles.css
   Paleta: #F5FAFE fondo | #5BBFEF azul | #4A90E2 botones | #7BC67B verde | #3F4A59 texto
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Poppins:wght@400;500;600;700&family=Montserrat:wght@700;800&display=swap');

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #F5FAFE;
  --blue:      #5BBFEF;
  --blue-dark: #4A90E2;
  --green:     #7BC67B;
  --text:      #3F4A59;
  --text-light:#6B7A8D;
  --white:     #FFFFFF;
  --shadow-sm: 0 2px 12px rgba(91,191,239,.18);
  --shadow-md: 0 6px 28px rgba(91,191,239,.22);
  --radius:    20px;
  --transition:0.45s cubic-bezier(.4,0,.2,1);
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  overflow: hidden;
}

/* ---- SCREEN SYSTEM ---- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(.98);
  transition: opacity var(--transition), transform var(--transition);
  background: var(--bg);
  overflow-y: auto;
}

.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: none;
}

.screen-inner {
  width: 100%;
  max-width: 420px;
  min-height: 100svh;
  padding: 48px 28px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* =============================================
   PANTALLA 1 – BIENVENIDA
   ============================================= */

/* Drop group (animated) */
.drop-group {
  position: relative;
  width: 80px;
  height: 90px;
  margin-bottom: 4px;
}

.drop {
  position: absolute;
  background: linear-gradient(145deg, #82d4f7, var(--blue));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: float 3s ease-in-out infinite;
}

.drop-main {
  width: 52px; height: 62px;
  left: 50%; transform: translateX(-50%);
  top: 0;
  box-shadow: 0 8px 24px rgba(91,191,239,.4);
  animation-delay: 0s;
}

.drop-shine {
  position: absolute;
  width: 14px; height: 14px;
  background: rgba(255,255,255,.55);
  border-radius: 50%;
  top: 10px; left: 10px;
}

.drop-sm {
  width: 22px; height: 28px;
  animation-delay: .6s;
  opacity: .75;
}
.drop-left  { bottom: 0; left: 0; }
.drop-right { bottom: 4px; right: 0; animation-delay: 1.1s; }

@keyframes float {
  0%,100% { transform: translateY(0) translateX(-50%); }
  50%      { transform: translateY(-8px) translateX(-50%); }
}
.drop-sm.drop-left { animation: floatSm 3s ease-in-out infinite .6s; }
.drop-sm.drop-right { animation: floatSm 3s ease-in-out infinite 1.1s; }

@keyframes floatSm {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* Title */
.logo-area { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.app-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -1px;
}
.app-title span { color: var(--blue); }

/* Welcome card */
.welcome-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid rgba(91,191,239,.15);
  text-align: center;
}

.welcome-text {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}
.welcome-text strong { color: var(--blue-dark); }

/* CTA Button */
.btn-main {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .08em;
  border: none;
  border-radius: 50px;
  padding: 18px 44px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(74,144,226,.38);
  transition: transform .15s, box-shadow .15s;
  width: 100%;
  justify-content: center;
}
.btn-main:hover  { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(74,144,226,.42); }
.btn-main:active { transform: scale(.97); }
.btn-icon { font-size: 1.2rem; }

.footer-note {
  font-size: .85rem;
  color: var(--text-light);
  font-family: 'Poppins', sans-serif;
  margin-top: 4px;
}
.footer-note strong { color: var(--text); }

/* =============================================
   STEP HEADER (shared)
   ============================================= */
.step-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.step-badge {
  font-family: 'Poppins', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue-dark);
  background: rgba(91,191,239,.12);
  border-radius: 30px;
  padding: 5px 14px;
  letter-spacing: .03em;
}

.progress-dots { display: flex; gap: 7px; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(91,191,239,.22);
  transition: background .3s;
}
.dot-active { background: var(--blue); }
.dot-done   { background: var(--green); }

/* =============================================
   STEP TITLE (shared)
   ============================================= */
.step-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.18rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  line-height: 1.55;
}
.step-title.big { font-size: 1.3rem; }

/* =============================================
   PANTALLA 2 – TAP ILLUSTRATION
   ============================================= */
.illustration {
  position: relative;
  width: 180px;
  height: 180px;
  flex-shrink: 0;
}

/* Tap (faucet) */
.tap-body {
  position: absolute;
  width: 40px; height: 22px;
  background: linear-gradient(135deg, #b0d8ef, #5BBFEF);
  border-radius: 8px;
  top: 40px; left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(91,191,239,.3);
}
.tap-handle {
  position: absolute;
  width: 8px; height: 28px;
  background: linear-gradient(to bottom, #c8e8f8, #5BBFEF);
  border-radius: 4px;
  top: 14px; left: 50%;
  transform: translateX(-50%);
}
.tap-spout {
  position: absolute;
  width: 28px; height: 12px;
  background: linear-gradient(135deg, #b0d8ef, #5BBFEF);
  border-radius: 0 0 8px 8px;
  top: 58px; left: 50%;
  transform: translateX(-50%);
}

/* Water stream from tap */
.water-stream {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.stream-drop {
  width: 6px; height: 12px;
  background: linear-gradient(to bottom, var(--blue), rgba(91,191,239,.3));
  border-radius: 50%;
  animation: fall 0.8s linear infinite;
}
.stream-drop:nth-child(1) { animation-delay: 0s; }
.stream-drop:nth-child(2) { animation-delay: .2s; }
.stream-drop:nth-child(3) { animation-delay: .4s; }
.stream-drop:nth-child(4) { animation-delay: .6s; }

@keyframes fall {
  0%   { opacity: 0; transform: translateY(-4px); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(18px); }
}

/* Hands under faucet */
.hands-under {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.hand {
  width: 30px; height: 22px;
  background: #f4d8b8;
  border-radius: 6px 6px 10px 10px;
  position: relative;
}
.hand::before {
  content: '';
  position: absolute;
  top: -6px; left: 3px;
  width: 6px; height: 10px;
  background: #f4d8b8;
  border-radius: 3px 3px 0 0;
  box-shadow: 8px 0 #f4d8b8, 16px 0 #f4d8b8;
}

/* =============================================
   PANTALLA 3 – SOAP ILLUSTRATION
   ============================================= */
.soap-illustration { display: flex; justify-content: center; align-items: center; }
.soap-hands { position: relative; width: 140px; height: 120px; }

.soap-hand {
  position: absolute;
  width: 55px; height: 38px;
  background: #f4d8b8;
  border-radius: 8px 8px 14px 14px;
  bottom: 10px;
}
.soap-left  { left: 8px;  transform: rotate(10deg); }
.soap-right { right: 8px; transform: rotate(-10deg); }

.foam-center {
  position: absolute;
  width: 60px; height: 24px;
  background: rgba(255,255,255,.85);
  border-radius: 50%;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  filter: blur(3px);
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.7);
  border: 1.5px solid rgba(91,191,239,.3);
  animation: bubble-float 2.5s ease-in-out infinite;
}
.b1 { width:18px;height:18px; top:8px;  left:20px;  animation-delay:0s; }
.b2 { width:12px;height:12px; top:4px;  left:65px;  animation-delay:.4s; }
.b3 { width:14px;height:14px; top:14px; right:14px; animation-delay:.8s; }
.b4 { width:10px;height:10px; top:0;    left:50%;   animation-delay:1.2s; }
.b5 { width:8px; height:8px;  top:22px; left:8px;   animation-delay:1.6s; }

@keyframes bubble-float {
  0%,100% { transform: translateY(0) scale(1); opacity: .8; }
  50%      { transform: translateY(-8px) scale(1.08); opacity: 1; }
}

/* =============================================
   BAR TIMER (screens 2 & 4)
   ============================================= */
.timer-bar-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.timer-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(91,191,239,.15);
  border-radius: 100px;
  overflow: hidden;
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-dark));
  border-radius: 100px;
  transform-origin: left;
  transition: transform .1s linear;
}
.timer-bar-fill.fill-green {
  background: linear-gradient(90deg, var(--green), #4CAF50);
}

.timer-count {
  font-family: 'Montserrat', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

/* =============================================
   CIRCULAR TIMER (screen 3)
   ============================================= */
.circular-timer-wrap {
  position: relative;
  width: 130px; height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circular-timer {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(91,191,239,.15);
  stroke-width: 8;
}

.circle-fill {
  fill: none;
  stroke: url(#grad-blue);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset .1s linear;
}

.circular-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

.circular-count {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}

.circular-label {
  font-size: .75rem;
  color: var(--text-light);
  font-family: 'Poppins', sans-serif;
  margin-top: 2px;
}

/* =============================================
   PANTALLA 4 – RINSE ILLUSTRATION
   ============================================= */
.rinse-illustration { display: flex; justify-content: center; align-items: center; }

.rinse-tap {
  position: absolute;
  width: 36px; height: 20px;
  background: linear-gradient(135deg, #b0d8ef, #5BBFEF);
  border-radius: 6px;
  top: 30px; left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(91,191,239,.3);
}
.rinse-tap::before {
  content: '';
  position: absolute;
  width: 7px; height: 24px;
  background: linear-gradient(to bottom, #c8e8f8, #5BBFEF);
  border-radius: 4px;
  top: -22px; left: 50%;
  transform: translateX(-50%);
}

.rinse-stream {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.rinse-drop {
  width: 5px;
  background: linear-gradient(to bottom, rgba(91,191,239,.9), rgba(91,191,239,.1));
  border-radius: 50%;
  animation: rinse-fall 0.6s linear infinite;
}
.rd1 { height: 20px; animation-delay: 0s; }
.rd2 { height: 16px; animation-delay: .12s; }
.rd3 { height: 24px; animation-delay: .06s; }
.rd4 { height: 18px; animation-delay: .18s; }
.rd5 { height: 14px; animation-delay: .24s; }

@keyframes rinse-fall {
  0%   { opacity: 0; transform: translateY(-4px); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(22px); }
}

.rinse-hands {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.rinse-hand {
  width: 32px; height: 24px;
  background: #f4d8b8;
  border-radius: 6px 6px 12px 12px;
}
.rinse-hand::before {
  content: '';
  position: absolute;
  top: -5px; left: 3px;
  width: 5px; height: 9px;
  background: #f4d8b8;
  border-radius: 3px 3px 0 0;
  box-shadow: 7px 0 #f4d8b8, 14px 0 #f4d8b8;
}

.soap-residue {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.65);
  filter: blur(2px);
  animation: dissolve 1.5s ease-in-out infinite;
}
.sr1 { width: 12px; height: 12px; bottom: 55px; left: 64px;  animation-delay: 0s; }
.sr2 { width: 9px;  height: 9px;  bottom: 60px; right: 60px; animation-delay: .5s; }

@keyframes dissolve {
  0%,100% { opacity: .7; transform: scale(1); }
  50%      { opacity: .2; transform: scale(.6) translateY(-4px); }
}

/* Progress legend */
.progress-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.leg-item {
  font-size: .72rem;
  font-family: 'Poppins', sans-serif;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.leg-blue  { background: rgba(91,191,239,.15); color: var(--blue-dark); }
.leg-green { background: rgba(123,198,123,.2);  color: #4CAF50; }
.leg-teal  { background: rgba(74,144,226,.12);  color: var(--blue-dark); }

/* =============================================
   PANTALLA 5 – FINAL
   ============================================= */
.screen-final {
  background: linear-gradient(160deg, #e8f5fb 0%, var(--bg) 60%);
}

.final-check {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--green), #4CAF50);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  box-shadow: 0 6px 24px rgba(123,198,123,.4);
  animation: pop .5s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.final-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

/* Happy drop */
.drop-happy {
  position: relative;
  width: 100px; height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dh-body {
  position: relative;
  width: 70px; height: 85px;
  background: linear-gradient(145deg, #82d4f7, var(--blue));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 8px 28px rgba(91,191,239,.4);
  animation: bounce-drop 2s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes bounce-drop {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.dh-face { position: relative; margin-top: 16px; width: 50px; }
.dh-eye {
  position: absolute;
  width: 9px; height: 9px;
  background: var(--white);
  border-radius: 50%;
  top: 0;
}
.el { left: 8px; }
.er { right: 8px; }
.dh-eye::after {
  content: '';
  width: 4px; height: 4px;
  background: var(--text);
  border-radius: 50%;
  position: absolute;
  bottom: 1px; right: 1px;
}
.dh-smile {
  position: absolute;
  width: 24px; height: 12px;
  border: 3.5px solid var(--white);
  border-top: none;
  border-radius: 0 0 24px 24px;
  top: 14px; left: 50%;
  transform: translateX(-50%);
}
.dh-shine {
  position: absolute;
  width: 14px; height: 14px;
  background: rgba(255,255,255,.5);
  border-radius: 50%;
  top: 10px; left: 10px;
}

/* Ripple rings */
.dh-ripple {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(91,191,239,.4);
  animation: ripple-out 2.4s ease-out infinite;
}
.r1 { width: 80px;  height: 80px;  animation-delay: 0s; }
.r2 { width: 100px; height: 100px; animation-delay: .5s; }
.r3 { width: 120px; height: 120px; animation-delay: 1s; }

@keyframes ripple-out {
  0%   { opacity: .6; transform: scale(.6); }
  100% { opacity: 0;  transform: scale(1.2); }
}

/* Warning badge */
.warning-badge {
  background: rgba(255,200,50,.12);
  border: 1.5px solid rgba(255,190,30,.35);
  border-radius: 14px;
  padding: 14px 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
}
.warning-icon { font-size: 1.3rem; flex-shrink: 0; }
.warning-text {
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  line-height: 1.6;
  color: #7a6000;
}

/* Message card */
.message-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--green);
  width: 100%;
}
.random-message {
  font-family: 'Poppins', sans-serif;
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text);
  text-align: center;
  font-style: italic;
}

/* Auto-return counter */
.auto-return {
  font-size: .8rem;
  color: var(--text-light);
  font-family: 'Poppins', sans-serif;
  background: rgba(91,191,239,.1);
  border-radius: 30px;
  padding: 6px 18px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 380px) {
  .screen-inner { padding: 36px 18px 32px; gap: 18px; }
  .app-title    { font-size: 2rem; }
  .step-title   { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}