/* Pantallas de ingreso (login, contraseña, registro) con estilo de heladería:
   fondo crema de fresa con chispas, borde "derretido" arriba y bolas de helado
   pastel flotando. .login-screen recibe max-width, min-height:100vh y flex
   column desde style.css; aqui solo su apariencia. */
:root {
  --rosa-50: #fff5f8;
  --rosa-100: #fde7ee;
  --rosa-200: #f8d2de;
  --rosa-300: #f2b2c5;
  --rosa-400: #e88aa4;
  --rosa-500: #d27391;
  --rosa-600: #bf6d81;
  --rosa-700: #a65368;
  --baya: #6d2a41;
  --baya-suave: #8a5a6a;
  --fresa: #f27a9b;
  --mango: #f5c04a;
  --menta: #6cc79a;
}

/* Fondo de la pagina fuera del contenedor (pantallas anchas y zonas seguras) */
body:has(.login-screen) {
  background: var(--rosa-100);
}

.login-screen {
  position: relative;
  overflow: hidden;
  /* Borde "derretido" arriba: gotas de tamaño fijo repetidas a lo ancho, dibujadas
     en el mismo fondo (sin capa aparte, asi no aparece ninguna linea de corte). */
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='50' viewBox='0 0 160 50'%3E%3Cpath d='M0 0H160V20H130C126 20 124 22 124 26V30C124 34 120 37 115 37C110 37 106 34 106 30V26C106 22 104 20 100 20H60C56 20 53 23 53 28V40C53 45 47 48 40 48C33 48 27 45 27 40V28C27 23 24 20 20 20H0Z' fill='%23f2b2c5'/%3E%3C/svg%3E") left 0 top env(safe-area-inset-top, 0px) / 160px 50px repeat-x,
    linear-gradient(#f2b2c5, #f2b2c5) left top / 100% calc(env(safe-area-inset-top, 0px) + 1px) no-repeat,
    radial-gradient(110% 60% at 90% 0%, #ffd6e2 0%, rgba(255, 214, 226, 0) 60%),
    linear-gradient(175deg, #fff4f7 0%, #fde6ed 55%, #fad6e1 100%);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 24px calc(24px + env(safe-area-inset-bottom, 0px));
}

/* ---------- bolas de helado de fondo ---------- */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.55;
  pointer-events: none;
  will-change: transform;
}

.orb-a {
  width: 260px;
  height: 260px;
  top: 90px;
  right: -110px;
  background: #f7a1b9;
  opacity: 0.32;
  animation: drift 14s ease-in-out infinite;
}

.orb-b {
  width: 240px;
  height: 240px;
  top: 300px;
  left: -130px;
  background: #ffc4d4;
  opacity: 0.4;
  animation: drift 18s ease-in-out infinite reverse;
}

.orb-c {
  width: 220px;
  height: 220px;
  bottom: 120px;
  right: -90px;
  background: #f59ab4;
  opacity: 0.25;
  animation: drift 16s ease-in-out infinite;
  animation-delay: 1.5s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(24px, -20px) scale(1.08);
  }
  66% {
    transform: translate(-18px, 16px) scale(0.96);
  }
}

/* Chispas de colores */
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, transparent calc(env(safe-area-inset-top, 0px) + 50px), #000 calc(env(safe-area-inset-top, 0px) + 64px), #000 35%, transparent 80%);
  mask-image: linear-gradient(to bottom, transparent 0, transparent calc(env(safe-area-inset-top, 0px) + 50px), #000 calc(env(safe-area-inset-top, 0px) + 64px), #000 35%, transparent 80%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg stroke-linecap='round' stroke-width='3.2'%3E%3Cline x1='14' y1='18' x2='22' y2='12' stroke='%23f27a9b'/%3E%3Cline x1='70' y1='10' x2='72' y2='20' stroke='%236cc79a'/%3E%3Cline x1='100' y1='40' x2='108' y2='44' stroke='%23f5c04a'/%3E%3Cline x1='40' y1='52' x2='34' y2='60' stroke='%23b69cf0'/%3E%3Cline x1='88' y1='82' x2='96' y2='78' stroke='%23f27a9b'/%3E%3Cline x1='18' y1='94' x2='20' y2='104' stroke='%23f5c04a'/%3E%3Cline x1='58' y1='104' x2='66' y2='108' stroke='%236cc79a'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: 56px 0 28px;
}

.brandmark {
  align-self: center;
  border-radius: 22px;
  background: #ffffff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 32px rgba(166, 83, 104, 0.2);
  animation: rise 0.6s ease both;
}

.brandmark img {
  height: 44px;
  width: auto;
  display: block;
}

.hero-copy {
  animation: rise 0.6s ease 0.1s both;
}

.hero-title {
  font-size: clamp(32px, 10vw, 42px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--baya);
  margin: 0 0 12px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.hero-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--baya-suave);
  margin: 0 auto;
  max-width: 300px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  animation: rise 0.6s ease 0.2s both;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--baya);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--rosa-200);
  border-radius: 999px;
  padding: 7px 13px;
  box-shadow: 0 4px 12px rgba(166, 83, 104, 0.08);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fresa);
}

.chip:nth-child(2) .chip-dot {
  background: var(--mango);
}

.chip:nth-child(3) .chip-dot {
  background: var(--menta);
}

/* ---------- dock (formulario abajo) ---------- */
.dock {
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  margin: 0 -24px calc(-24px - env(safe-area-inset-bottom, 0px));
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(166, 83, 104, 0.14);
  animation: rise 0.6s ease 0.3s both;
}

.dock-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--baya);
  margin: 0 0 12px;
  padding-left: 2px;
}

.dock-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dock-field,
.signup-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rosa-50);
  border: 1.5px solid var(--rosa-200);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--rosa-600);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dock-field:focus-within,
.signup-field:focus-within {
  background: #ffffff;
  border-color: var(--rosa-400);
  box-shadow: 0 0 0 4px rgba(232, 138, 164, 0.2);
}

.dock-field svg,
.signup-field svg {
  flex-shrink: 0;
}

.dock-field input,
.signup-field input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #3d1f2a;
  width: 100%;
  min-width: 0;
  font-family: inherit;
}

.dock-field input::placeholder,
.signup-field input::placeholder {
  color: #c4a0ab;
}

.dock-send {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, var(--rosa-400), var(--rosa-600));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(191, 109, 129, 0.38);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.dock-send:active {
  transform: scale(0.9);
  box-shadow: 0 6px 14px rgba(191, 109, 129, 0.3);
}

.dock-error {
  background: #fdecec;
  border: 1px solid #f6b9b9;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 14px;
  text-align: center;
}

/* ---------- estado de exito ---------- */
.dock-success {
  background: var(--rosa-50);
  border: 1px solid var(--rosa-200);
  border-radius: 20px;
  padding: 18px;
}

.dock-success-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dock-success-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--rosa-100);
  color: var(--rosa-600);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dock-success-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.dock-success-text strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--baya);
}

.dock-success-text span {
  font-size: 13px;
  color: var(--baya-suave);
  line-height: 1.45;
}

.dock-success-note {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--rosa-200);
  font-size: 12px;
  color: var(--baya-suave);
  line-height: 1.5;
  text-align: center;
}

.dock-retry {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rosa-600);
  text-decoration: none;
  text-align: center;
}

.dock-retry:active {
  opacity: 0.7;
}

/* ---------- completar perfil (signup) y contraseñas ---------- */
.signup-hero {
  gap: 16px;
  padding-top: 24px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.signup-field {
  flex: none;
  padding: 14px 16px;
  border-radius: 16px;
}

.signup-field-static {
  color: var(--baya-suave);
  font-size: 14px;
  background: var(--rosa-100);
}

.signup-field-static span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signup-submit {
  margin-top: 4px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(145deg, var(--rosa-400), var(--rosa-600));
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(191, 109, 129, 0.38);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.signup-submit:active {
  transform: scale(0.97);
  box-shadow: 0 6px 14px rgba(191, 109, 129, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .brandmark,
  .hero-copy,
  .chips,
  .dock {
    animation: none;
  }
}
