/* 🎨 FRUTTILU versión infantil y animada */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;700&display=swap');

:root {
  --fru-azul: #0066ff;
  --fru-naranja: #ff9f1c;
  --fru-verde: #3cb44b;
  --fru-rosa: #ff6392;
  --fru-amarillo: #ffe156;
  --fru-morado: #8e44ad;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  font-family: "Baloo 2", sans-serif;
  color: #222;
  background: linear-gradient(180deg, #fdf6ff, #e1f5ff 60%, #fdf6ff);
  overflow-x: hidden;
}

/* 🌈 Fondo animado con burbujas */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(var(--fru-rosa) 3px, transparent 4px),
                    radial-gradient(var(--fru-amarillo) 2px, transparent 4px),
                    radial-gradient(var(--fru-verde) 2px, transparent 4px);
  background-size: 120px 120px, 160px 160px, 200px 200px;
  background-position: 0 0, 60px 60px, 100px 0;
  animation: floatBubbles 20s linear infinite;
  opacity: 0.15;
  z-index: 0;
}

@keyframes floatBubbles {
  from { background-position: 0 0, 60px 60px, 100px 0; }
  to { background-position: 0 -600px, 60px -540px, 100px -480px; }
}

/* 🪄 Tarjetas principales */
.card {
  position: relative;
  width: min(92vw, 440px);
  background: white;
  border-radius: 32px;
  padding: clamp(20px, 3vw, 40px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  z-index: 1;
  animation: bounceIn 0.8s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); }
}

.logo {
  width: 180px;
  height: auto;
  display: block;
  margin-bottom: 0.4rem;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* 🧸 Formularios */
.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.login-form h2 {
  text-align: center;
  margin: 0.2rem 0 0.6rem;
  font-size: 1.6rem;
  color: var(--fru-azul);
}

.login-form label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--fru-morado);
}

.login-form input {
  padding: 0.7rem 1rem;
  border-radius: 16px;
  border: 2px solid #cfd7e3;
  background: #fff;
  font-size: 1rem;
  transition: border-color 0.2s, transform 0.1s;
}

.login-form input:focus {
  border-color: var(--fru-azul);
  transform: scale(1.03);
  outline: none;
  box-shadow: 0 0 8px var(--fru-azul);
}

.login-form button {
  margin-top: 0.6rem;
  padding: 0.9rem 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--fru-rosa), var(--fru-naranja));
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transition: transform 0.1s ease, filter 0.2s ease;
}

.login-form button:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.login-form button:active {
  transform: scale(0.97);
}

/* 🧃 Botón genérico FRUTTILU */
.btn-fruttilu {
  display: inline-block;
  font-weight: 700;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--fru-verde), var(--fru-azul));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(31,38,151,0.25);
  transition: transform 0.1s, filter 0.2s;
}
.btn-fruttilu:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

/* 📊 Barra de progreso */
.progress {
  background: #eee;
  border-radius: 16px;
  height: 22px;
  overflow: hidden;
  width: 100%;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--fru-verde), var(--fru-amarillo), var(--fru-naranja));
  border-radius: 16px;
  transition: width 0.6s ease;
}

/* 🥇 Alertas */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 2px solid transparent;
  font-size: 1rem;
  text-align: center;
}
.alert.error {
  background: #ffe8e8;
  border-color: #f3b5b5;
  color: #7a1d1d;
}
.alert.success {
  background: #e7ffe7;
  border-color: #b6e2b6;
  color: #1f6f2a;
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 🎉 Confeti animado */
@keyframes confetti {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(400px) rotate(720deg); opacity: 0; }
}

.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--color);
  top: 0;
  left: calc(var(--x) * 1%);
  border-radius: 50%;
  animation: confetti 2s linear forwards;
}

/* 🧭 Centrado vertical del contenido principal */
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem 0;
}

/* —— Progreso de la semana: tarjeta centrada y tabla bonita —— */
.weekly-card{
  width:min(680px, 100%);
  margin: 0 auto;
  background: #fff;
  border: 2px solid rgba(31,74,168,.08);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 10px 30px rgba(31,74,168,.10);
}

.weekly-header{
  display:flex; align-items:center; justify-content:center; gap:.6rem;
  margin-bottom:.2rem;
}
.weekly-header .emoji{ font-size:1.25rem; }
.weekly-header h3{ margin:0; color:var(--fru-azul); }

.avg-row{
  display:flex; justify-content:center; align-items:center; gap:.6rem;
  margin:.2rem 0 .8rem;
  font-weight:700;
}
.avg-badge{
  display:inline-block;
  padding:.2rem .7rem;
  border-radius:999px;
  color:#fff;
  font-weight:800;
  letter-spacing:.3px;
  background: linear-gradient(135deg, var(--fru-verde), var(--fru-azul));
  box-shadow:0 6px 16px rgba(0,0,0,.12);
}

.weekly-table-wrap{ overflow:auto; }
.weekly-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:.95rem;
}
.weekly-table th,
.weekly-table td{ padding:.55rem .7rem; }
.weekly-table thead th{
  background: var(--fru-azul);
  color:#fff;
  text-align:center;
}
.weekly-table thead th:first-child{ border-top-left-radius:10px; text-align:left;}
.weekly-table thead th:last-child{ border-top-right-radius:10px; }

.weekly-table tbody tr:nth-child(even){ background:#f4f7ff; }
.weekly-table tbody tr:hover{ background:#eaf0ff; }

.weekly-table td{ text-align:center; }
.weekly-table td:first-child{ text-align:left; white-space:nowrap; }
