@import url("https://fonts.googleapis.com/css2?family=Sora:wght@300;400;600;700;800&display=swap");

:root{
  --bg:#0a0a0c;
  --side-bg:#0d0e10;
  --panel:#161616;
  --text:#f3f4f6;
  --muted:#a8b0bd;
  --border:#202226;
  --input-bg:rgba(0,0,0,.35);
  --input-border:rgba(255,255,255,.14);
  --accent-1:#000AD0;
  --accent-2:#0009B4;
  --accent-3:#000898;
  --shadow:0 30px 70px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"Sora", "Segoe UI", sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  zoom:.96;
}

.auth-page{
  min-height:100vh;
  position:relative;
  overflow:hidden;
}

.auth-vignette{
  position:fixed;
  inset:0;
  background:var(--bg);
  pointer-events:none;
}

.auth-wrap{
  position:relative;
  z-index:2;
  min-height:100vh;
  display:grid;
  align-items:center;
  justify-items:center;
  padding:clamp(24px, 6vw, 80px);
}

.auth-page--split{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(440px,.62fr);
}

.auth-side{
  position:relative;
  z-index:2;
  min-height:100vh;
  padding:clamp(28px, 4vw, 64px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:32px;
  background:var(--side-bg);
  border-right:1px solid var(--border);
}

.side-hero{ max-width:480px; margin:auto 0; }
.side-hero h1{
  margin:0 0 14px;
  font-size:clamp(28px, 3vw, 38px);
  line-height:1.1;
  letter-spacing:-.03em;
  font-weight:800;
}
.side-hero > p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.65;
}

.side-points{
  display:grid;
  gap:14px;
  margin-top:32px;
}
.side-point{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.side-check{
  flex:none;
  width:20px;
  height:20px;
  display:grid;
  place-items:center;
  color:#8f9dff;
}
.side-check svg{
  width:14px;
  height:14px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.side-point b{
  display:block;
  font-size:12.5px;
  font-weight:700;
}
.side-point span{
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-size:11.5px;
  line-height:1.5;
}

.side-foot{
  color:#6d7482;
  font-size:10.5px;
}
.side-foot-link{
  color:#9aa3b5;
  text-decoration:none;
  font-weight:700;
  letter-spacing:.01em;
  border-bottom:1px solid transparent;
  transition:color .15s ease, border-color .15s ease;
}
.side-foot-link:hover{
  color:#c7cede;
  border-color:currentColor;
}

@media (max-width: 1080px){
  .auth-page--split{ grid-template-columns:1fr; }
  .auth-side{ display:none; }
}

.auth-card{
  width:min(420px, 100%);
  padding:28px;
}

.auth-panels{
  position:relative;
  overflow:hidden;
}
.auth-panels--single{
  overflow:visible;
}
.auth-panel{
  width:100%;
  transition:transform .45s ease, opacity .35s ease;
}
.auth-panel--reset{
  position:absolute;
  inset:0;
  transform:translateY(16px);
  opacity:0;
  pointer-events:none;
}
.auth-page.is-reset .auth-panel--login{
  transform:translateY(-16px);
  opacity:0;
  pointer-events:none;
}
.auth-page.is-reset .auth-panel--reset{
  transform:translateY(0);
  opacity:1;
  pointer-events:auto;
}
.auth-panels--single .auth-panel--reset{
  position:relative;
  inset:auto;
  transform:none;
  opacity:1;
  pointer-events:auto;
}

.auth-logo{
  display:block;
  height:46px;
  width:auto;
  margin-bottom:20px;
  filter:drop-shadow(0 8px 18px rgba(0,0,0,.35));
  color:#fff;
  fill:currentColor;
}
.auth-logo .st0{ fill:currentColor; }

.auth-head{ margin-bottom:16px; }
.auth-title{
  margin:0;
  font-size:28px;
  font-weight:800;
  letter-spacing:-0.02em;
}
.title-dot{
  color:var(--accent-3);
}
.auth-sub{
  margin:8px 0 0;
  font-size:13px;
  color:var(--muted);
}

.auth-form{ display:grid; gap:14px; }

.field{ display:grid; gap:6px; }
.label{
  font-size:12px;
  font-weight:700;
  color:#d4dae5;
}

.input{
  width:100%;
  height:44px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--input-border);
  background:var(--input-bg);
  outline:none;
  font-size:12px;
  color:var(--text);
  transition:box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.input::placeholder{ color:#7c8696; }
.input:focus{
  border-color:rgba(0,10,208,.6);
  box-shadow:0 0 0 3px rgba(0,10,208,.18);
  background:rgba(255,255,255,.08);
}
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text);
  caret-color:var(--text);
  -webkit-box-shadow:0 0 0 1000px var(--input-bg) inset;
  box-shadow:0 0 0 1000px var(--input-bg) inset;
  transition:background-color 9999s ease-in-out 0s;
}

.field-line,
.input-with-icon{ position:relative; }
.field-line--icon .input,
.input-with-icon .input{ padding-right:44px; }

.icon-btn{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  cursor:pointer;
  display:grid;
  place-items:center;
}
.icon-btn svg{ width:18px; height:18px; fill:#c1c9d6; }

.auth-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:#d4dae5;
  user-select:none;
}
.check input{ width:16px; height:16px; }

.msg{
  margin:0;
  min-height:16px;
  text-align:left;
  font-size:11px;
  color:#f87171;
}
.msg.is-ok{
  color:#4ade80;
}

.btn{
  height:44px;
  border:0;
  border-radius:12px;
  padding:0 14px;
  font-weight:800;
  font-size:12px;
  cursor:pointer;
  transition:transform .15s ease, filter .2s ease;
}
.btn.primary{
  background:var(--accent-1);
  color:#fff;
  border:1px solid var(--accent-1);
  box-shadow:none;
}
.btn.primary:hover{ filter:none; background:var(--accent-2); border-color:var(--accent-2); }
.btn.primary:active{ transform:translateY(1px); }
.btn.biometric{
  margin-top:10px;
  color:#eef2ff;
  background:transparent;
  border:1px solid rgba(199,203,233,.55);
}
.btn.biometric:hover{ border-color:#fff; background:rgba(255,255,255,.07); }
.btn:disabled{ opacity:.7; cursor:not-allowed; }
.w100{ width:100%; }

.auth-help{
  text-align:center;
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

.link{
  color:#c7b7ff;
  text-decoration:none;
  font-weight:700;
}
.link:hover{ text-decoration:underline; }
.link.subtle{ color:#a8b0bd; }

@media (max-width: 720px){
  .auth-wrap{
    align-items:center;
    justify-items:center;
  }
}

@media (max-width: 480px){
  .auth-card{
    width:100%;
    max-width:100%;
    border-radius:24px;
    padding:24px 20px;
    margin:0 12px;
  }

  .auth-card input[type="text"],
  .auth-card input[type="email"],
  .auth-card input[type="password"]{
    min-height:48px;
    font-size:16px;
    border-radius:14px;
  }

  .auth-card button[type="submit"],
  .auth-card .auth-btn{
    min-height:50px;
    font-size:15px;
    border-radius:14px;
  }
}

@media (max-width: 360px){
  .auth-card{
    padding:20px 16px;
    margin:0 8px;
    border-radius:20px;
  }
}

/* PWA mobile — onda clara + folha escura. Desktop fica no layout dividido. */
.auth-mast,
.auth-mast-wave,
.auth-seg,
.auth-join{ display:none; }

@media (max-width: 767px){
  html{ color-scheme:dark; }
  body.auth-page{
    zoom:1;
    display:flex;
    flex-direction:column;
    min-height:100dvh;
    min-height:100svh;
    background:#fff;
    color:#f5f5f7;
    font-family:system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing:antialiased;
    overflow:hidden;
    touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;
  }
  .auth-vignette{ display:none; }
  .auth-page--split{
    display:flex;
    flex-direction:column;
    grid-template-columns:none;
    background:#fff;
  }
  .auth-side{ display:none; }

  .auth-mast{
    position:relative;
    z-index:2;
    display:flex;
    flex:none;
    align-items:center;
    justify-content:center;
    height:clamp(236px, 37dvh, 310px);
    padding:calc(20px + env(safe-area-inset-top)) 24px 88px;
    background:transparent;
    overflow:visible;
  }
  /* O S agora é a borda de cima da folha escura (.auth-wrap::before). */
  .auth-mast-wave{ display:none; }
  .auth-mark-wrap{
    position:relative;
    z-index:1;
    display:grid;
    place-items:center;
    width:min(188px, 48vw);
  }
  .auth-mark{
    position:relative;
    z-index:1;
    width:100%;
    height:auto;
    display:block;
    filter:
      drop-shadow(0 14px 22px rgba(0,0,0,.16))
      drop-shadow(0 2px 4px rgba(0,0,0,.08));
    animation:auth-mark-float 4.8s cubic-bezier(.45,.05,.55,.95) infinite;
    will-change:transform;
  }
  .auth-mark-shine{
    position:absolute;
    inset:-18% -30%;
    z-index:2;
    pointer-events:none;
    background:linear-gradient(
      115deg,
      transparent 36%,
      rgba(255,255,255,.0) 42%,
      rgba(255,255,255,.55) 50%,
      rgba(255,255,255,.0) 58%,
      transparent 64%
    );
    mix-blend-mode:soft-light;
    transform:translateX(-130%);
    animation:auth-mark-shine 4.8s cubic-bezier(.22, 1, .36, 1) 1.1s infinite;
  }
  @keyframes auth-mark-float{
    0%, 100%{ transform:translate3d(0,0,0); }
    50%{ transform:translate3d(0,-7px,0); }
  }
  @keyframes auth-mark-shine{
    0%, 62%{ transform:translateX(-130%); opacity:0; }
    68%{ opacity:.9; }
    82%{ transform:translateX(130%); opacity:0; }
    100%{ transform:translateX(130%); opacity:0; }
  }

  .auth-wrap{
    position:relative;
    z-index:1;
    flex:1 1 auto;
    min-height:0;
    display:flex;
    align-items:stretch;
    justify-content:stretch;
    padding:0;
    margin-top:0;
    background:#121214;
  }
  /* S na diagonal: sobe à esquerda, desce à direita. */
  .auth-wrap::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:calc(100% - 1px);
    height:112px;
    pointer-events:none;
    background:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 112' preserveAspectRatio='none'><defs><filter id='b' x='-5%' y='-40%' width='110%' height='180%'><feGaussianBlur stdDeviation='7'/></filter></defs><path d='M0,118 L0,30 C150,24 236,108 400,98 L400,118 Z' fill='%23000' opacity='.16' filter='url(%23b)' transform='translate(0,-7)'/><path d='M0,113 L0,30 C150,24 236,108 400,98 L400,113 Z' fill='%23121214'/></svg>") center bottom / 100% 100% no-repeat;
  }
  .auth-card{
    width:100%;
    max-width:none;
    margin:0;
    padding:14px 28px calc(28px + env(safe-area-inset-bottom));
    background:transparent;
    color:#f5f5f7;
    border-radius:0;
    box-shadow:none;
  }
  .auth-logo,
  .auth-head{ display:none; }

  .auth-seg{
    position:relative;
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:center;
    gap:0;
    margin:0 0 36px;
    padding:4px;
    border-radius:999px;
    background:#2a2a2e;
  }
  .auth-seg-pill{
    position:absolute;
    top:4px;
    bottom:4px;
    left:4px;
    width:calc(50% - 4px);
    border-radius:999px;
    background:#d8d8dc;
    transform:translateX(0);
    transition:transform .42s cubic-bezier(.22, 1, .36, 1);
  }
  .auth-page.is-join .auth-seg-pill{ transform:translateX(100%); }
  .auth-seg-btn{
    position:relative;
    z-index:1;
    height:38px;
    margin:0;
    padding:0 8px;
    border:0;
    border-radius:999px;
    background:transparent;
    color:rgba(255,255,255,.55);
    font:600 15px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing:-.01em;
    cursor:pointer;
    transition:transform 100ms ease-out, color 160ms ease-out;
  }
  .auth-seg-btn.is-on{ color:#141416; }
  .auth-page.is-join .auth-seg-btn.is-on{ color:#141416; }
  .auth-page.is-join .auth-seg-btn:not(.is-on),
  .auth-seg-btn:not(.is-on){ color:rgba(255,255,255,.55); }
  .auth-seg-btn:active{ transform:scale(.97); }
  .auth-seg-btn:focus-visible{
    outline:2px solid #fff;
    outline-offset:2px;
  }

  .auth-page.is-join .auth-panel--login{ display:none; }
  .auth-join{
    display:none;
    margin:4px 0 0;
  }
  .auth-join:not([hidden]){ display:block; }
  .auth-join p{
    margin:0;
    color:rgba(255,255,255,.78);
    font-size:16px;
    font-weight:400;
    line-height:1.45;
    letter-spacing:-.011em;
  }
  .auth-join b{ font-weight:600; color:#fff; }

  .auth-form{ gap:28px; }
  .field{ gap:8px; }
  .label{
    font-size:15px;
    font-weight:500;
    letter-spacing:-.011em;
    color:#f2f2f4;
  }
  .field-line{
    position:relative;
    display:block;
    width:100%;
    border:0;
    border-bottom:1.5px solid rgba(255,255,255,.34);
    background:transparent;
    transition:border-color 160ms ease-out;
  }
  .field:focus-within .field-line{ border-bottom-color:#fff; }
  .auth-card .field-line .input,
  .auth-card .input{
    display:block;
    width:100%;
    height:42px;
    min-height:42px;
    margin:0;
    padding:4px 0 10px;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    outline:none;
    font:400 17px/1.2 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing:-.011em;
    color:#fff !important;
    caret-color:#fff;
    -webkit-text-fill-color:#fff;
  }
  .auth-card .field-line--icon .input{ padding-right:44px; }
  .auth-card .input::placeholder{
    color:rgba(255,255,255,.42);
    -webkit-text-fill-color:rgba(255,255,255,.42);
    opacity:1;
    font-weight:400;
  }
  .auth-card .input:focus{
    border:0 !important;
    background:transparent !important;
    box-shadow:none !important;
  }
  .field-line .icon-btn{
    position:absolute;
    right:-4px;
    bottom:2px;
    top:auto;
    transform:none;
    width:40px;
    height:40px;
    border:0;
    border-radius:12px;
    background:transparent;
  }
  .field-line .icon-btn svg{ fill:rgba(255,255,255,.72); }
  .field-line .icon-btn:active{ transform:scale(.92); }
  .auth-card .input:-webkit-autofill,
  .auth-card .input:-webkit-autofill:hover,
  .auth-card .input:-webkit-autofill:focus{
    -webkit-text-fill-color:#fff !important;
    caret-color:#fff;
    transition:background-color 9999s ease-in-out 0s;
    -webkit-box-shadow:0 0 0 1000px #121214 inset !important;
    box-shadow:0 0 0 1000px #121214 inset !important;
  }

  .msg{
    min-height:0;
    font-size:14px;
    font-weight:500;
    letter-spacing:-.01em;
    color:#ff6961;
  }
  .msg:empty{ display:none; }

  .auth-card .btn.primary,
  .auth-card .btn.primary:hover{
    height:52px;
    margin-top:8px;
    border:0;
    border-radius:999px;
    background:#fff;
    color:#141416;
    font-size:16px;
    font-weight:600;
    letter-spacing:-.011em;
    filter:none;
    box-shadow:none;
    transition:transform 100ms ease-out, background-color 100ms ease-out;
  }
  .auth-card .btn.primary:active{
    transform:scale(.97);
    background:#f2f2f4;
  }
  .auth-card .btn.primary:disabled{
    opacity:.55;
    transform:none;
  }

  /* Entrada: a folha escura sobe com o S e encontra o topo branco;
     a marca desce de leve ao mesmo tempo e o formulário aparece depois. */
  body.auth-page:not(.is-ready) .auth-mast{
    transform:translate3d(0, -18px, 0);
    opacity:0;
  }
  body.auth-page:not(.is-ready) .auth-mark-wrap{
    transform:translate3d(0, -10px, 0) scale(.92);
    opacity:0;
  }
  body.auth-page:not(.is-ready) .auth-wrap{
    transform:translate3d(0, calc(100% + 120px), 0);
  }
  body.auth-page:not(.is-ready) .auth-card{
    transform:translate3d(0, 22px, 0);
    opacity:0;
  }
  body.auth-page .auth-mast{
    transition:
      transform .9s cubic-bezier(.22, 1, .36, 1),
      opacity .6s ease-out;
  }
  body.auth-page .auth-mark-wrap{
    transition:
      transform 1s cubic-bezier(.22, 1, .36, 1) .08s,
      opacity .6s ease-out .08s;
  }
  body.auth-page .auth-wrap{
    transition:transform 1.05s cubic-bezier(.16, 1, .3, 1) .14s;
    will-change:transform;
  }
  body.auth-page .auth-card{
    transition:
      transform .7s cubic-bezier(.22, 1, .36, 1) .62s,
      opacity .5s ease-out .62s;
  }
  body.auth-page.is-ready .auth-mast,
  body.auth-page.is-ready .auth-mark-wrap,
  body.auth-page.is-ready .auth-wrap,
  body.auth-page.is-ready .auth-card{
    transform:none;
    opacity:1;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce){
  body.auth-page .auth-mast,
  body.auth-page .auth-mark-wrap,
  body.auth-page .auth-wrap,
  body.auth-page .auth-card,
  .auth-seg-pill,
  .auth-seg-btn,
  .auth-card .btn.primary,
  .field-line{ transition:none; }
  .auth-mark,
  .auth-mark-shine{ animation:none !important; }
  body.auth-page:not(.is-ready) .auth-mast,
  body.auth-page:not(.is-ready) .auth-mark-wrap,
  body.auth-page:not(.is-ready) .auth-wrap,
  body.auth-page:not(.is-ready) .auth-card{
    transform:none;
    opacity:1;
  }
  .auth-seg-btn:active,
  .auth-card .btn.primary:active{ transform:none; }
  .field-line .icon-btn:active{ transform:none; }
}

@media (max-width: 767px) and (prefers-contrast: more){
  .field-line{ border-bottom-color:#fff; }
  .auth-seg{ outline:1px solid rgba(255,255,255,.7); }
  .auth-mast-wave{ box-shadow:none; }
  .auth-mark{ filter:none; }
}
