/* Fondo general */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: #F1F5F8; /* color corporativo */
}

.background {
  /*background: url('../assets/img/fondo.jpg') no-repeat center center fixed;*/
  background-size: cover;
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: -1;
  filter: brightness(0.7);
}

.container {
  background: rgba(216, 229, 234, 0.95); /* #D8E5EA semi-transparente */
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.15);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

/* CONTENEDOR DE LOGOS */
.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px; /* separación entre logos */
  width: 100%;
}

/* LOGO APP */
.logo {
  width: 100%;
  max-width: 120px;
  height: auto;
}

/* LOGO UA */
.logo_ua {
  width: 55%;
  max-width: 220px;
  height: auto;
}

@media (max-width: 600px) {
  .logos {
    flex-direction: column; /* en móvil uno debajo del otro */
    gap: 10px;
  }

  .logo {
    width: 35%;
  }

  .logo_ua {
    width: 70%;
  }
}

.tabs {
  display: flex;
  margin-bottom: 20px;
}

.tab {
  flex:1;
  text-align:center;
  padding:10px;
  cursor:pointer;
  font-weight:bold;
  border-bottom:2px solid #CCCCCC;
  color: #005682;
  transition:0.3s;
}

.tab.active {
  border-bottom:2px solid #005682;
  color:#005682;
}

.auth-container form {
  display: none;
}

.auth-container form.active {
  display: block;
}

input {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border:1px solid #CCCCCC;
  border-radius:5px;
}

button {
  width:100%;
  padding:10px;
  margin:10px 0;
  background:#FFD23A;
  color:#005682;
  border:none;
  border-radius:5px;
  cursor:pointer;
  font-size:1em;
  font-weight:bold;
  transition: 0.3s;
}

button:hover {
  background:#FF6633;
  color:white;
}

.error {
  color:#FF6633;
  margin-bottom:10px;
  text-align:center;
  font-weight:bold;
}

@media (max-width:400px){
  .container { padding:20px; }
  .logo { width:100px; }
}

/* POPUP BASE */
#welcome-popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Cuando está activo */
#welcome-popup.active {
  display: flex;
  opacity: 1;
}

/* CONTENIDO DEL POPUP */
.popup-content {
  background: #D8E5EA;
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: all 0.4s ease;
}

/* Animación del contenido */
#welcome-popup.active .popup-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* CARD */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

/* CARD */
.card {
  background: white;
  border-radius: 16px;
  overflow: hidden; /* 🔑 CLAVE para que la imagen respete el borde */
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.15);
}

/* IMAGEN SUPERIOR */
.card-image {
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 🔑 recorta sin deformar */
  display: block;
}

/* CONTENIDO */
.card-content {
  padding: 20px;
}

.card-content h2 {
  margin-top: 0;
  color: #005682;
}

.card-content p {
  color: #555;
  line-height: 1.4;
}

/* HOME */
.home-container {
  max-width: 900px;
  width: 95%;
  margin: 100px auto;
  padding: 20px;
  background: rgba(216, 229, 234, 0.95);
  border-radius: 10px;
  text-align: center;
}

header {
  display: flex;
  justify-content: center; /* Logo centrado */
  align-items: center;
  margin-bottom: 30px;
  position: relative;
}

/* PROFILE ICON flotante arriba derecha */
.profile-menu {
  position: absolute;
  right: 20px; /* distancia del borde derecho */
  top: 10px;   /* distancia del borde superior */
}

.profile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FFD23A;
  color: #005682;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  cursor: pointer;
  border: 2px solid #005682;
  transition: 0.3s;
}

.profile-icon:hover {
  background: #FF6633;
  color: white;
  border-color: #FF6633;
}

/* DROPDOWN */
.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 50px;
  background: #D8E5EA;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  min-width: 150px;
  z-index: 10;
  overflow: hidden;
}

.dropdown-item {
  padding: 10px 15px;
  cursor: pointer;
  color: #005682;
  font-weight: bold;
  transition: 0.3s;
}

.dropdown-item:hover {
  background: #FFD23A;
  color: white;
}

#typewriter::after {
  content: "|";
  animation: blink 1s infinite;
  margin-left: 3px;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0; }
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#result-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#result-modal.active {
  display: flex;
}

.modal-content {
  background: #D8E5EA;
  padding: 20px;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  animation: zoomIn 0.3s ease;
}

.modal-content img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 15px;
}

@keyframes zoomIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.camera-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #FFD23A; /* color corporativo */
  color: #005682;      /* color icono */
  border: none;
  font-size: 1.8em;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: transform 0.2s;
}

.camera-fab:hover {
  transform: scale(1.1);
}

/* Toast general */
.camera-toast {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px); /* desenfoque de fondo */
    transition: opacity 0.3s ease;
}

.camera-toast-content {
    background: #fff;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    max-width: 90%;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    transform: translateY(-50px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.camera-toast.show .camera-toast-content {
    transform: translateY(0);
    opacity: 1;
}

/* Botón cerrar */
.toast-close-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: #FF6633;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.toast-close-btn:hover {
    background: #FFD23A;
}

/* ==== Estilos móviles tipo toast ==== */
@media (max-width: 600px) {
    .camera-toast-content {
        position: fixed;
        bottom: -100%;
        left: 50%;
        transform: translateX(-50%);
        width: 90%;
        max-width: 400px;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    }

    .camera-toast.show .camera-toast-content {
        bottom: 0;
        transform: translateX(-50%);
    }
}

.perfil-main {
  max-width: 500px;
  margin: 40px auto;
  padding: 20px;
  background: #F1F5F8;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.perfil-main h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #005682;
}

.perfil-form .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.perfil-form label {
  margin-bottom: 6px;
  font-weight: bold;
  color: #333;
}

.perfil-form input,
.perfil-form select,
.perfil-form textarea {
  padding: 10px;
  border: 1px solid #CCCCCC;
  border-radius: 8px;
  font-size: 1em;
}

.perfil-form textarea {
  resize: vertical;
  min-height: 60px;
}

.perfil-form .btn-submit {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  background-color: #FF6633;
  color: white;
  font-size: 1.1em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.perfil-form .btn-submit:hover {
  background-color: #FF6633cc;
}

/* Responsive */
@media (max-width: 600px) {
  .perfil-main {
    margin: 20px;
    padding: 15px;
  }
}

.step {
  display: none;
  animation: fadeIn 0.4s ease;
}

.step.active {
  display: block;
}

.next-btn,
.prev-btn {
  margin-top: 20px;
  padding: 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.next-btn {
  background: #005682;
  color: white;
}

.prev-btn {
  background: #CCCCCC;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.wheel-container {
  position: relative;
  width: 100%;
  height: 80px;
  overflow: hidden;
  margin: 20px 0;
}

.wheel {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  height: 100%;
  padding: 0 20px; /* espacio a los lados para centrar el número */
}

.wheel::-webkit-scrollbar {
  display: none;
}

.wheel-item {
  flex: 0 0 60px; /* ancho de cada item */
  line-height: 80px;
  text-align: center;
  font-size: 1.2rem;
  color: #999;
  scroll-snap-align: center;
  transition: all 0.2s ease;
}

.wheel-item.active {
  font-size: 2rem;
  font-weight: bold;
  color: #005682;
}

/* Barras verticales selector */
.wheel-container::before,
.wheel-container::after {
  content: "";
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: #ddd;
  pointer-events: none;
}

.wheel-container::before {
  left: 50%;
  transform: translateX(-40px); /* barra izquierda */
}

.wheel-container::after {
  left: 50%;
  transform: translateX(40px); /* barra derecha */
}

.gender-selector {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
}

.gender-card {
  flex: 1;
  background: #fff;
  border-radius: 14px;
  padding: 20px 10px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  transition: all 0.25s ease;
}

.gender-card .emoji {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 8px;
}

.gender-card span {
  font-weight: 600;
  color: #333;
}

.gender-card:hover {
  transform: translateY(-4px);
}

.gender-card.active {
  border-color: #005682;
  background: #EAF4FA;
  transform: translateY(-6px);
}

.activity-selector {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin: 20px 0;
}

.activity-card {
  flex: 1;
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.2s ease;
}

.activity-card .emoji {
  font-size: 28px;
  display: block;
}

.activity-card .title {
  font-weight: 600;
  margin-top: 6px;
  display: block;
}

.activity-card.active {
  border-color: #4CAF50; /* o tu color principal */
  background: #f0fff4;
}

.preferences-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.pref-item {
  background: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #eee;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.2s ease;
}

.pref-item:hover {
  border-color: #4CAF50;
}

.pref-item input {
  transform: scale(1.1);
  accent-color: #4CAF50;
}

.objectives-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.objective-card {
  background: #fff;
  padding: 18px;
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  border: 2px solid #eee;
  transition: 0.2s ease;
}

.objective-card .emoji {
  font-size: 30px;
  display: block;
  margin-bottom: 6px;
}

.objective-card .title {
  font-weight: 600;
}

.objective-card.active {
  border-color: #4CAF50;
  background: #f0fff4;
}

/* ==========================
   FIX SCROLL PERFIL (MÓVIL)
========================== */

body.perfil-page {
  display: block;              /* rompe el centrado vertical */
  height: auto;                /* deja crecer el contenido */
  min-height: 100vh;
  overflow-y: auto;            /* scroll vertical */
}

body.perfil-page .container,
body.perfil-page .home-container {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.perfil-form .btn-submit {
  position: sticky;
  bottom: 10px;
}

/* ==========================
   FIX SCROLL HORIZONTAL
========================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body.perfil-page {
  overflow-x: hidden;
}

.perfil-form {
  max-width: 100%;
  overflow-x: hidden;
}

input, select, textarea, button {
  width: 100%;
}

/* ==========================
   FIX SCROLL HOME (MÓVIL)
========================== */

body.home-page {
  display: block;        /* rompe centrado vertical */
  height: auto;          /* permite crecer el contenido */
  min-height: 100vh;
  overflow-y: auto;      /* habilita scroll vertical */
  overflow-x: hidden;    /* evita scroll horizontal */
}

body.home-page .container,
body.home-page .home-container {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

body.alimentacion-page {
  display: block;        /* rompe centrado vertical */
  height: auto;          /* permite crecer el contenido */
  min-height: 100vh;
  overflow-y: auto;      /* habilita scroll vertical */
  overflow-x: hidden;    /* evita scroll horizontal */
}

body.alimentacion-page .container,
body.alimentacion-page .home-container {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.alimentacion-page ul {
  list-style: none; /* quita los puntos */
  padding-left: 0;  /* quita el espacio de sangría */
  margin-left: 0;   /* opcional, ajusta margen */
}

body.foto-page {
  display: block;              /* rompe el centrado vertical */
  height: auto;                /* deja crecer el contenido */
  min-height: 100vh;
  overflow-y: auto;            /* scroll vertical */
}

body.foto-page .container,
body.foto-page .home-container {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

#toast-image {
    max-width: 200px;   /* ancho máximo */
    max-height: 200px;  /* alto máximo */
    object-fit: cover;  /* mantiene proporción y recorta si hace falta */
    border-radius: 8px; /* opcional, bordes redondeados */
}