/* ================================================
   NUTRI PRIME — LOGIN v4
   Usa as mesmas fontes e tokens do design-system
   ================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: #f5f5f7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}
input, button {
  -webkit-user-select: auto;
  user-select: auto;
}

/* ════════════════════════════════════════════════
   SPLASH (Apple-style)
   ════════════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.splash.hide {
  opacity: 0;
  pointer-events: none;
}

.splash__logo {
  width: 130px;
  height: auto;
  animation: splash-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash__pulse {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1.5px solid rgba(34,197,94,0.25);
  animation: splash-pulse 1.6s ease-out both;
  pointer-events: none;
}

@keyframes splash-pop {
  0%   { opacity: 0; transform: scale(0.72); }
  65%  { opacity: 1; transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes splash-pulse {
  0%   { opacity: 0.7; transform: scale(0.7); }
  100% { opacity: 0; transform: scale(2.2); }
}

/* ════════════════════════════════════════════════
   OVERLAY DE VERIFICAÇÃO — tela cheia minimalista
   ════════════════════════════════════════════════ */
.verify-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;   /* dynamic viewport height — melhor no iOS */
  z-index: 99998;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.verify-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.verify-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

/* Spinner rotativo */
.verify-spinner svg {
  animation: verify-spin 0.8s linear infinite;
  display: block;
}

@keyframes verify-spin {
  to { transform: rotate(360deg); }
}

/* Ícone de resultado (check ou X) — injetado por JS */
.verify-result svg {
  animation: result-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes result-pop {
  0%   { opacity: 0; transform: scale(0.5); }
  70%  { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.verify-result__label {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  animation: result-pop 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

/* Check animado */
.svg-check-ring {
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  animation: draw-ring 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}
.svg-check-mark {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: draw-mark 0.3s cubic-bezier(0.22, 1, 0.36, 1) 0.48s forwards;
}
.svg-x-ring {
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  animation: draw-ring 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

@keyframes draw-ring { to { stroke-dashoffset: 0; } }
@keyframes draw-mark { to { stroke-dashoffset: 0; } }

/* ════════════════════════════════════════════════
   BACKGROUND AMBIENTAL
   ════════════════════════════════════════════════ */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background-color: #f5f5f7;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px) saturate(120%);
  opacity: 0.7;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.orb-1 {
  width: 55vw; height: 55vw;
  background: #86efac;
  top: -15%; left: -10%;
  animation: orb-float-1 25s infinite cubic-bezier(0.4, 0, 0.2, 1) alternate;
}

.orb-2 {
  width: 65vw; height: 65vw;
  background: #bbf7d0;
  bottom: -20%; right: -15%;
  animation: orb-float-2 28s infinite cubic-bezier(0.4, 0, 0.2, 1) alternate-reverse;
}

.orb-3 {
  width: 45vw; height: 45vw;
  background: #4ade80;
  top: 40%; left: 60%;
  animation: orb-float-3 32s infinite cubic-bezier(0.4, 0, 0.2, 1) alternate;
}

@keyframes orb-float-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(15vw, 15vh) scale(1.1); }
}
@keyframes orb-float-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-10vw, -15vh) scale(0.9); }
}
@keyframes orb-float-3 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-20vw, 10vh) scale(1.2); }
}

/* ════════════════════════════════════════════════
   PÁGINA
   ════════════════════════════════════════════════ */
.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-page.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ════════════════════════════════════════════════
   LOGO
   ════════════════════════════════════════════════ */
.lp-logo {
  text-align: center;
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
}

.lp-logo img {
  height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════
   CARD
   ════════════════════════════════════════════════ */
.lp-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(48px) saturate(180%);
  -webkit-backdrop-filter: blur(48px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 32px;
  padding: 40px 32px 32px;
  box-shadow: 
    0 40px 80px rgba(0, 0, 0, 0.05),
    0 10px 30px rgba(0, 0, 0, 0.03),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  animation: rise 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.lp-card__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
  text-align: center;
}

.lp-card__sub {
  font-size: 0.9375rem;
  color: #86868b;
  margin-bottom: 32px;
  line-height: 1.5;
  text-align: center;
  font-weight: 500;
}

/* ── Campo ── */
.lp-field {
  position: relative;
  margin-bottom: 14px;
}

/* Wrapper só do input+ícone para o top:50% funcionar corretamente */
.lp-input-wrap {
  position: relative;
}

.lp-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
}

.lp-field:focus-within .lp-input-wrap .lp-input-icon { color: var(--accent); }

.lp-input {
  width: 100%;
  padding: 16px 16px 16px 48px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: #1d1d1f;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-appearance: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.lp-input::placeholder { color: #86868b; font-weight: 400; }

.lp-input:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15), inset 0 2px 4px rgba(0,0,0,0);
}



.lp-input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.09);
}

/* Erro inline */
.lp-error {
  font-size: 0.8125rem;
  color: var(--red);
  font-weight: 500;
  margin-top: 7px;
  padding-left: 4px;
  display: none;
  animation: rise 0.2s ease both;
}

.lp-error.show { display: block; }

.lp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 16px;
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.lp-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.lp-btn:active {
  transform: scale(0.97);
}

/* ── Footer ── */
.lp-card__footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 18px;
  border-top: 1px solid var(--border-glass);
}

.lp-card__footer a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.lp-card__footer a:hover { opacity: 0.75; }

/* ════════════════════════════════════════════════
   PROVA SOCIAL
   ════════════════════════════════════════════════ */
.lp-social {
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.04);
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both;
}

.lp-social__stars {
  color: #f59e0b;
  font-size: 0.875rem;
  letter-spacing: 2px;
  margin-bottom: 8px;
}

.lp-social__quote {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.55;
  margin-bottom: 12px;
}

.lp-social__author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lp-social__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gradient-green);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lp-social__author strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-heading);
}

.lp-social__author span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════
   KEYFRAMES BASE
   ════════════════════════════════════════════════ */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

/* ════════════════════════════════════════════════
   MOBILE
   ════════════════════════════════════════════════ */
@media (max-width: 440px) {
  .login-page { padding: 24px 16px 40px; gap: 12px; }
  .lp-card { padding: 26px 22px 22px; border-radius: 18px; }
  .lp-card__title { font-size: 1.3125rem; }
  .lp-logo img { height: 48px; }
}
