/* ============================================================
   petZy · Login
   Identidade: verde-menta, ink escuro, Nunito + Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Inter:wght@400;500;600&display=swap');

:root {
  --green:        #4ECBA0;
  --green-dark:   #3db88e;
  --green-light:  #E8FAF3;
  --green-mid:    #F0FAF6;
  --green-border: #D4EDE4;
  --ink:          #1A2E2A;
  --ink-mid:      #2E4E4A;
  --muted:        #4A6660;
  --hint:         #7A9E99;
  --surface:      #F7FCF9;
  --white:        #ffffff;
  --coral:        #FF7B6B;
  --erro:         #C84B3A;
  --erro-fundo:   #FFF0EE;
  --erro-borda:   #F5C4B3;

  --sombra-sm: 0 1px 3px rgba(26,46,42,.07);
  --sombra-md: 0 8px 28px -10px rgba(26,46,42,.18);
  --sombra-lg: 0 24px 56px -18px rgba(26,46,42,.26);

  --raio:    16px;
  --raio-sm: 12px;
  --transi:  200ms cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: var(--green-mid);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Layout geral ──────────────────────────────────────────── */
.cena {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
}

.painel { display: none; }

.formzona {
  display: grid;
  place-items: center;
  padding: clamp(1.25rem, 4vw, 3rem);
  background: var(--green-mid);
}

/* ── Cartão do formulário ──────────────────────────────────── */
.cartao {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 0.5px solid var(--green-border);
  border-radius: var(--raio);
  padding: clamp(1.75rem, 5vw, 2.75rem);
  box-shadow: var(--sombra-lg);
  animation: surgir 550ms cubic-bezier(.2,.7,.2,1) both;
}

@keyframes surgir {
  from { opacity: 0; transform: translateY(14px) scale(.988); }
  to   { opacity: 1; transform: none; }
}

.cartao__topo,
.alerta,
.campo,
.linha-aux,
.botao,
.rodape { animation: subir 480ms ease both; }
.cartao__topo           { animation-delay: .05s; }
.alerta                 { animation-delay: .08s; }
.campo:nth-of-type(1)   { animation-delay: .12s; }
.campo:nth-of-type(2)   { animation-delay: .18s; }
.linha-aux              { animation-delay: .24s; }
.botao                  { animation-delay: .30s; }
.rodape                 { animation-delay: .36s; }

@keyframes subir {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: none; }
}

/* ── Marca / logo ──────────────────────────────────────────── */
.marca { display: inline-flex; align-items: center; gap: .55rem; }

.marca__pata {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  color: #0E2420;
  background: var(--green);
  border-radius: 12px;
  box-shadow: var(--sombra-sm);
}
.marca--mini .marca__pata { width: 32px; height: 32px; border-radius: 10px; }

.marca__nome {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 6.2rem;
  letter-spacing: -.02em;
  color: var(--ink);
}
.marca__nome span { color: var(--green); }

/* ── Cabeçalho do cartão ───────────────────────────────────── */
.cartao__topo { margin-bottom: 1.6rem; }
.cartao__topo .marca { margin-bottom: 1.5rem; }

.cartao__topo h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  letter-spacing: -.03em;
  line-height: 1.08;
  color: var(--ink);
}
.cartao__topo p {
  color: var(--muted);
  font-size: .95rem;
  margin-top: .4rem;
  line-height: 1.5;
}

/* ── Alerta de erro ────────────────────────────────────────── */
.alerta {
  display: flex; align-items: center; gap: .55rem;
  background: var(--erro-fundo);
  color: var(--erro);
  border: 1px solid var(--erro-borda);
  border-radius: var(--raio-sm);
  padding: .7rem .9rem;
  font-size: .875rem;
  margin-bottom: 1.2rem;
  animation: subir 400ms ease both, tremer 440ms ease .08s;
}
.alerta svg { flex: 0 0 auto; }

@keyframes tremer {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-5px); }
  40%     { transform: translateX(4px); }
  60%     { transform: translateX(-3px); }
  80%     { transform: translateX(2px); }
}

/* ── Campos (label flutuante) ──────────────────────────────── */
.campo { position: relative; margin-bottom: 1rem; }

.campo input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--green-border);
  border-radius: var(--raio-sm);
  padding: 1.35rem 2.6rem .55rem .95rem;
  transition: border-color var(--transi), background var(--transi), box-shadow var(--transi);
}
.campo input:hover { border-color: #9ECFBE; }
.campo input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(78,203,160,.15);
}

.campo label {
  position: absolute;
  left: .95rem; top: 50%;
  transform: translateY(-50%);
  color: var(--hint);
  font-size: 1rem;
  pointer-events: none;
  transition: all 160ms ease;
}
.campo input:focus + label,
.campo input:not(:placeholder-shown) + label {
  top: .62rem;
  transform: none;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--green-dark);
}

.campo__icone {
  position: absolute; right: .9rem; top: 50%;
  transform: translateY(-50%);
  color: var(--hint);
  pointer-events: none;
  display: flex;
}
.campo input:focus ~ .campo__icone { color: var(--green); }

/* Botão mostrar/ocultar senha */
.campo__olho {
  position: absolute; right: .6rem; top: 50%;
  transform: translateY(-50%);
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border: none; background: transparent;
  color: var(--hint); cursor: pointer;
  border-radius: 8px;
  transition: color var(--transi), background var(--transi);
}
.campo__olho:hover { color: var(--green); background: var(--green-light); }

/* Campo inválido */
.campo.invalido input {
  border-color: var(--erro);
  background: var(--erro-fundo);
}
.campo .dica {
  display: block;
  color: var(--erro);
  font-size: .78rem;
  margin: .35rem 0 0 .2rem;
  animation: subir 250ms ease both;
}

/* ── Linha auxiliar ────────────────────────────────────────── */
.linha-aux {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
  margin: .3rem 0 1.4rem;
}

.lembrar {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .875rem; color: var(--muted);
  cursor: pointer; user-select: none;
}
.lembrar input { position: absolute; opacity: 0; width: 0; height: 0; }

.lembrar__caixa {
  width: 19px; height: 19px;
  border: 1.5px solid var(--green-border);
  border-radius: 6px;
  background: var(--surface);
  display: grid; place-items: center;
  transition: all var(--transi);
}
.lembrar__caixa::after {
  content: "";
  width: 10px; height: 6px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg) scale(0);
  transition: transform 180ms cubic-bezier(.2,.8,.2,1.4);
  margin-top: -2px;
}
.lembrar input:checked + .lembrar__caixa {
  background: var(--green);
  border-color: var(--green);
}
.lembrar input:checked + .lembrar__caixa::after { transform: rotate(-45deg) scale(1); }
.lembrar input:focus-visible + .lembrar__caixa { box-shadow: 0 0 0 3px rgba(78,203,160,.25); }

.esqueci {
  font-size: .875rem;
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 500;
  position: relative;
}
.esqueci::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1.5px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--transi);
}
.esqueci:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── Botão principal ───────────────────────────────────────── */
.botao {
  position: relative;
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: #0E2420;
  background: var(--green);
  border: none;
  border-radius: 50px;
  padding: 1rem 1rem;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 20px -6px rgba(78,203,160,.55);
  transition: transform var(--transi), box-shadow var(--transi), background var(--transi);
}
.botao:hover {
  background: var(--green-dark);
  box-shadow: 0 10px 28px -8px rgba(78,203,160,.65);
  transform: translateY(-1px);
}
.botao:active { transform: translateY(0) scale(.99); }
.botao:focus-visible { outline: 3px solid rgba(78,203,160,.4); outline-offset: 2px; }

/* Shimmer ao hover */
.botao::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 600ms ease;
}
.botao:hover::before { transform: translateX(120%); }

/* Estado de carregamento */
.botao__spinner {
  position: absolute; inset: 0; margin: auto;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(14,36,32,.2);
  border-top-color: #0E2420;
  border-radius: 50%;
  opacity: 0;
  animation: rodar .7s linear infinite;
}
.botao.carregando { pointer-events: none; }
.botao.carregando .botao__texto { opacity: 0; }
.botao.carregando .botao__spinner { opacity: 1; }
@keyframes rodar { to { transform: rotate(360deg); } }

.rodape {
  text-align: center;
  font-size: .82rem;
  color: var(--hint);
  margin-top: 1.5rem;
}

/* ============================================================
   Painel decorativo (desktop) — fundo petZy ink escuro
   com bolhas em verde-menta
   ============================================================ */
@media (min-width: 900px) {
  .cena { grid-template-columns: 1.05fr .95fr; }

  .painel {
    display: block;
    position: relative;
    overflow: hidden;
    background: var(--ink);
    color: var(--white);
  }

  /* Mancha subtil de luz verde no canto */
  .painel::after {
    content: "";
    position: absolute;
    top: -120px; left: -80px;
    width: 480px; height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(78,203,160,.18) 0%, transparent 70%);
    pointer-events: none;
  }

  .painel__grão {
    position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  }

  .painel__conteudo {
    position: relative; z-index: 1;
    height: 100%;
    display: flex; flex-direction: column;
    justify-content: center;
    padding: clamp(3rem, 6vw, 5.5rem);
    gap: 1rem;
  }

  .painel .marca { color: var(--white); margin-bottom: 1.6rem; gap: .7rem; }
  .painel .marca__pata {
    background: rgba(78,203,160,.2);
    width: 54px; height: 54px;
    border-radius: 16px;
  }
  .painel .marca__nome {
    font-size: 6.2rem;
    letter-spacing: -.04em;
    color: var(--white);
  }
  .painel .marca__nome span { color: var(--green); }

  .painel__titulo {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.06;
    letter-spacing: -.04em;
    color: var(--white);
  }
  .painel__titulo .accent { color: var(--green); }

  .painel__sub {
    font-size: 1.05rem;
    color: rgba(255,255,255,.6);
    max-width: 36ch;
    line-height: 1.6;
  }

  /* ── Bolhas petZy ── */
  .bolhas { list-style: none; position: absolute; inset: 0; pointer-events: none; }

  .bolhas li {
    position: absolute; bottom: -60px;
    border-radius: 50%;
    /* bolha translúcida com brilho interno verde */
    background: radial-gradient(circle at 32% 28%,
      rgba(78,203,160,.55),
      rgba(78,203,160,.06) 65%);
    border: 1px solid rgba(78,203,160,.28);
    animation: flutuar 10s ease-in infinite;
    animation-delay: var(--d);
  }
  .bolhas li:nth-child(1) { left: 10%; width: 38px; height: 38px; }
  .bolhas li:nth-child(2) { left: 36%; width: 72px; height: 72px; }
  .bolhas li:nth-child(3) { left: 62%; width: 50px; height: 50px; }
  .bolhas li:nth-child(4) { left: 82%; width: 30px; height: 30px; }

  @keyframes flutuar {
    0%   { transform: translateY(0) scale(.6); opacity: 0; }
    12%  { opacity: .9; }
    100% { transform: translateY(-105vh) scale(1.1); opacity: 0; }
  }
}

/* ── Ecrãs muito largos ────────────────────────────────────── */
@media (min-width: 1500px) {
  .cartao { max-width: 445px; }
}

/* ── Acessibilidade: respeitar menos movimento ─────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}