/* ==========================================================================
   ZapsChat – Login minimal clean
   Hero escuro à esquerda + formulário compacto à direita
   Imagem: /frontend/img/login-hero-zapschat.png
   ========================================================================== */

:root{
  --brand:#008169;
  --brand-2:#00a879;
  --brand-3:#21d37a;
  --brand-dark:#006b56;

  --page:#ffffff;
  --text:#151922;
  --muted:#717b8c;
  --line:#dfe6ef;
  --soft:#f7fafc;
  --error:#ef4444;

  --form-w:318px;
  --input-h:46px;
  --radius-pill:999px;
  --focus:0 0 0 4px rgba(0,129,105,.12);
  --btn-shadow:0 14px 28px rgba(0,129,105,.20);
}

*{ box-sizing:border-box; }

html,body{ min-height:100%; }

html{
  font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  min-height:100vh;
  background:var(--page);
  color:var(--text);
  font-family:Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}

button,input{ font:inherit; }

a{ color:inherit; }

.hidden{ display:none !important; }

/* =========================
   Estrutura
   ========================= */

.login-page{
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr;
  background:#fff;
  overflow:hidden;
}

/* =========================
   Lado esquerdo
   ========================= */

.login-hero{
  position:relative;
  min-height:100vh;
  background:
    linear-gradient(180deg, rgba(0,0,0,.03), rgba(0,0,0,.12)),
    url("/frontend/img/login-hero-zapschat.png") center center / cover no-repeat;
  isolation:isolate;
}

.login-hero::after{
  content:"";
  position:absolute;
  inset:0;
  background:
    radial-gradient(circle at 0% 100%, rgba(33,211,122,.28), transparent 34%),
    linear-gradient(90deg, rgba(0,0,0,.06), transparent 45%);
  pointer-events:none;
  z-index:1;
}

/* =========================
   Lado direito
   ========================= */

.login-panel{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:42px 48px;
  background:
    radial-gradient(circle at 50% 18%, rgba(0,129,105,.035), transparent 32%),
    #fff;
}

.login-box{
  width:100%;
  max-width:var(--form-w);
  margin-inline:auto;
  text-align:center;
}

/* Header central */

.login-header{
  text-align:center;
  margin-bottom:28px;
}

.brand-logo{
  width:fit-content;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  color:var(--text);
  text-decoration:none;
  margin:0 auto 34px;
}

/* AQUI A LOGO FOI AUMENTADA */
.brand-mark{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  color:#20d577;
  flex:0 0 auto;
}

.brand-mark svg{
  width:100%;
  height:100%;
  display:block;
}

/* AQUI O TEXTO DA LOGO FOI AUMENTADO */
.brand-text{
  color:#111827;
  font-size:19px;
  font-weight:800;
  letter-spacing:-.55px;
  line-height:1;
}

.brand-text b{
  color:#1ccf73;
  font-weight:800;
}

.title{
  margin:0;
  color:#151922;
  font-size:26px;
  line-height:1.08;
  letter-spacing:-.85px;
  font-weight:800;
}

.subtitle{
  margin:8px 0 0;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.45;
  font-weight:500;
}

/* =========================
   Form
   ========================= */

.form{
  width:100%;
  margin-inline:auto;
}

.field{
  margin:0 0 17px;
}

.label{
  display:block;
  margin:0 0 8px;
  color:#151922;
  font-size:13.5px;
  line-height:1.2;
  font-weight:600;
  text-align:left;
}

.input-wrap{
  position:relative;
}

.field-icon{
  position:absolute;
  left:16px;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  color:#7c8798;
  pointer-events:none;
}

.input{
  width:100%;
  height:var(--input-h);
  border:1px solid var(--line);
  border-radius:var(--radius-pill);
  background:#fff;
  color:#151922;
  outline:none;
  padding:0 16px;
  font-size:13.5px;
  font-weight:500;
  box-shadow:0 1px 2px rgba(16,24,40,.02);
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.has-left-icon .input{
  padding-left:47px;
}

.has-right-icon .input{
  padding-right:48px;
}

.input::placeholder{
  color:#8b95a5;
  opacity:1;
}

.input:focus{
  border-color:rgba(0,129,105,.62);
  box-shadow:var(--focus), 0 1px 2px rgba(16,24,40,.03);
}

.input.is-invalid{
  border-color:rgba(239,68,68,.85);
  box-shadow:0 0 0 4px rgba(239,68,68,.10);
}

.field-help{
  display:block;
  margin-top:8px;
  color:var(--error);
  font-size:12.5px;
  font-weight:600;
  text-align:left;
}

.icon-btn{
  position:absolute;
  right:9px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#717b8c;
  display:grid;
  place-items:center;
  cursor:pointer;
  transition:background .16s ease, color .16s ease;
}

.icon-btn:hover{
  background:#f2f5f8;
  color:#151922;
}

.icon-btn:focus-visible{
  outline:none;
  box-shadow:var(--focus);
}

.icon-btn svg{
  display:block;
}

/* =========================
   Opções
   ========================= */

.login-options{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:-1px 0 28px;
}

.check-label{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#151922;
  font-size:13px;
  line-height:1.2;
  font-weight:500;
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
}

.check-label input{
  width:14px;
  height:14px;
  margin:0;
  border-radius:4px;
  accent-color:var(--brand);
  cursor:pointer;
}

.link{
  color:var(--brand);
  text-decoration:none;
  font-size:13px;
  font-weight:700;
  transition:color .16s ease;
  white-space:nowrap;
}

.link:hover{
  color:var(--brand-dark);
  text-decoration:underline;
  text-underline-offset:3px;
}

/* =========================
   Botões
   ========================= */

.btn-primary{
  width:100%;
  height:48px;
  border:0;
  border-radius:var(--radius-pill);
  background:linear-gradient(135deg, #00a879, #008169);
  color:#fff;
  font-size:15px;
  font-weight:800;
  letter-spacing:-.15px;
  cursor:pointer;
  box-shadow:var(--btn-shadow);
  transition:transform .16s ease, box-shadow .16s ease, filter .16s ease, opacity .16s ease;
}

.btn-primary:hover{
  transform:translateY(-1px);
  filter:brightness(.98);
  box-shadow:0 16px 30px rgba(0,129,105,.24);
}

.btn-primary:active{
  transform:translateY(0);
}

.btn-primary:focus-visible{
  outline:none;
  box-shadow:var(--focus), var(--btn-shadow);
}

.btn-primary[disabled]{
  opacity:.65;
  cursor:not-allowed;
  transform:none;
}

.btn-ghost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  background:transparent;
  color:#717b8c;
  font-size:13px;
  font-weight:700;
  padding:0;
  margin:0 0 22px;
  cursor:pointer;
}

.btn-ghost:hover{
  color:var(--brand);
  text-decoration:underline;
  text-underline-offset:3px;
}

/* =========================
   Token / 2 etapas
   ========================= */

.token-info{
  margin:0 0 13px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
  font-weight:500;
  text-align:left;
}

.token-input{
  text-align:center;
  letter-spacing:7px;
  font-size:15px;
  font-weight:800;
  padding-left:18px !important;
}

/* =========================
   Footer
   ========================= */

.footer-note{
  margin:28px 0 0;
  text-align:center;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
  font-weight:500;
}

.footer-note .link{
  font-size:13px;
}

/* =========================
   Erros
   ========================= */

.error-box{
  display:block;
  margin:0 0 18px;
  padding:11px 13px;
  border:1px solid #fecaca;
  border-radius:14px;
  background:#fef2f2;
  color:#dc2626;
  font-size:12.8px;
  font-weight:700;
  line-height:1.35;
  text-align:left;
}

.error-box:not(.hidden):not(:empty){
  animation:error-pop .18s ease-out both;
}

@keyframes error-pop{
  from{
    opacity:0;
    transform:translateY(-4px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

/* =========================
   Autofill Chrome / Edge
   ========================= */

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus{
  -webkit-text-fill-color:#151922;
  box-shadow:0 0 0 1000px #fff inset !important;
  caret-color:#151922;
  border-radius:var(--radius-pill);
}

/* =========================
   Responsivo
   ========================= */

@media (max-width:1180px){
  .login-panel{
    padding:40px 36px;
  }

  :root{
    --form-w:310px;
  }
}

@media (max-width:900px){
  .login-page{
    grid-template-columns:1fr;
    overflow:auto;
  }

  .login-hero{
    display:none;
  }

  .login-panel{
    min-height:100dvh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:34px 22px;
  }

  .login-box{
    max-width:340px;
    margin:auto;
    padding-top:0;
  }
}

@media (max-width:420px){
  :root{
    --form-w:100%;
    --input-h:45px;
  }

  .login-panel{
    padding:28px 18px;
  }

  .brand-logo{
    margin-bottom:28px;
    gap:8px;
  }

  .brand-mark{
    width:34px;
    height:34px;
  }

  .brand-text{
    font-size:18px;
  }

  .title{
    font-size:24px;
  }

  .subtitle{
    font-size:13px;
  }

  .login-options{
    align-items:flex-start;
    flex-direction:column;
    gap:12px;
    margin-bottom:24px;
  }

  .btn-primary{
    height:47px;
    font-size:14.5px;
  }
}

@media (max-height:760px) and (min-width:901px){
  .login-panel{
    padding-top:28px;
    padding-bottom:28px;
  }

  .brand-logo{
    margin-bottom:26px;
  }

  .login-header{
    margin-bottom:24px;
  }

  .field{
    margin-bottom:15px;
  }

  .login-options{
    margin-bottom:23px;
  }

  .footer-note{
    margin-top:24px;
  }

  .title{
    font-size:24px;
  }

  .subtitle{
    font-size:13px;
  }
}

/* Correção fina: em telas baixas o form não corta; em telas normais fica no centro real */
@media (max-height:640px){
  .login-panel{
    align-items:flex-start;
    overflow:auto;
  }

  .login-box{
    margin-top:22px;
    margin-bottom:22px;
  }
}