/*
* auth.css - telas publicas (login, esqueci a senha, criar teste)
* Tema claro/escuro pelo atributo <html data-mode="light|dark"> (mesmo "zg-theme" do painel)
******************************************************************************/

:root {
  --a-bg: #f4f6fb;
  --a-surface: #ffffff;
  --a-surface-2: #f6f7fc;
  --a-border: #e3e8f2;
  --a-text: #5b6b82;
  --a-heading: #1f2a44;
  --a-muted: #8a97ab;
  --a-primary: #696cff;
  --a-primary-2: #8b5cf6;
  --a-ok: #16a34a;
  --a-ok-bg: rgba(22, 163, 74, 0.1);
  --a-err: #e11d48;
  --a-err-bg: rgba(225, 29, 72, 0.09);
  --a-warn: #d97706;
  --a-warn-bg: rgba(217, 119, 6, 0.1);
  --a-shadow: 0 2px 6px rgba(31, 42, 68, 0.05), 0 20px 50px rgba(31, 42, 68, 0.1);
  color-scheme: light;
}

html[data-mode="dark"] {
  --a-bg: #0d1222;
  --a-surface: #161c32;
  --a-surface-2: #1c2440;
  --a-border: #2a3454;
  --a-text: #a9b4cc;
  --a-heading: #eef1fa;
  --a-muted: #7d8aa8;
  --a-primary: #7c7fff;
  --a-ok-bg: rgba(34, 197, 94, 0.14);
  --a-err-bg: rgba(251, 113, 133, 0.14);
  --a-warn-bg: rgba(251, 191, 36, 0.14);
  --a-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), 0 20px 50px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--a-bg);
  color: var(--a-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: var(--a-primary); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }

/* ---------- Estrutura ---------- */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-aside {
  position: relative;
  overflow: hidden;
  padding: 56px 56px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(140deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
}

.auth-aside::before,
.auth-aside::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  pointer-events: none;
}
.auth-aside::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.auth-aside::after { width: 320px; height: 320px; left: -110px; bottom: -110px; background: rgba(255, 255, 255, 0.06); }

.auth-aside > * { position: relative; z-index: 1; }

.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; letter-spacing: 0.2px; }
.auth-brand img { height: 46px; width: auto; max-width: 180px; object-fit: contain; border-radius: 10px; background: rgba(255, 255, 255, 0.95); padding: 4px 8px; }

.auth-aside h2 { color: #fff; font-size: 34px; line-height: 1.2; font-weight: 700; margin: 0 0 14px; }
.auth-aside p.lead { color: rgba(255, 255, 255, 0.86); font-size: 16px; margin: 0 0 30px; max-width: 460px; }

.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 460px; }
.auth-features li { display: flex; gap: 14px; align-items: flex-start; }
.auth-features .ico {
  flex: 0 0 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 21px;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(4px);
}
.auth-features b { display: block; color: #fff; font-weight: 600; }
.auth-features span { color: rgba(255, 255, 255, 0.8); font-size: 13.5px; }

.auth-aside .copy { color: rgba(255, 255, 255, 0.7); font-size: 13px; }
.auth-aside .copy a { color: #fff; }

.auth-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 20px;
  box-shadow: var(--a-shadow);
  padding: 36px 34px 30px;
  animation: auth-in 0.45s ease both;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.auth-mobile-brand { display: none; text-align: center; margin-bottom: 18px; }
.auth-mobile-brand img { height: 52px; max-width: 200px; object-fit: contain; }

.auth-card h1 { margin: 0 0 6px; font-size: 24px; font-weight: 700; color: var(--a-heading); }
.auth-card .sub { margin: 0 0 24px; color: var(--a-muted); }

/* ---------- Formulario ---------- */
.f-group { margin-bottom: 16px; }
.f-group label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--a-heading); }

.f-wrap { position: relative; }
.f-wrap > i.lead-ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--a-muted); font-size: 19px; pointer-events: none;
}
.f-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 44px 0 42px;
  border-radius: 12px;
  border: 1px solid var(--a-border);
  background: var(--a-surface-2);
  color: var(--a-heading);
  font: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.f-wrap input::placeholder { color: var(--a-muted); opacity: 0.8; }
.f-wrap input:focus {
  border-color: var(--a-primary);
  background: var(--a-surface);
  box-shadow: 0 0 0 4px rgba(105, 108, 255, 0.16);
}
.f-wrap .eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent;
  color: var(--a-muted); cursor: pointer; font-size: 19px; display: grid; place-items: center;
}
.f-wrap .eye:hover { color: var(--a-primary); background: rgba(105, 108, 255, 0.1); }

.f-row { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 18px; font-size: 13.5px; }

.turnstile-box { margin: 4px 0 18px; display: flex; justify-content: center; min-height: 65px; }

.btn-auth {
  width: 100%; height: 48px; border: 0; border-radius: 12px; cursor: pointer;
  color: #fff; font: inherit; font-weight: 600; font-size: 15px;
  background: linear-gradient(135deg, var(--a-primary), var(--a-primary-2));
  box-shadow: 0 8px 20px rgba(105, 108, 255, 0.32);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s;
}
.btn-auth:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(105, 108, 255, 0.4); }
.btn-auth:active { transform: translateY(0); }
.btn-auth[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-auth .spin {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-links { margin-top: 20px; text-align: center; font-size: 14px; }

/* ---------- Avisos ---------- */
.auth-alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; font-size: 14px;
  border: 1px solid transparent;
}
.auth-alert i { font-size: 19px; margin-top: 1px; }
.auth-alert.err { background: var(--a-err-bg); color: var(--a-err); border-color: rgba(225, 29, 72, 0.25); }
.auth-alert.ok { background: var(--a-ok-bg); color: var(--a-ok); border-color: rgba(22, 163, 74, 0.25); }
.auth-alert.warn { background: var(--a-warn-bg); color: var(--a-warn); border-color: rgba(217, 119, 6, 0.28); }

/* passos (criar teste) */
.auth-steps { list-style: none; counter-reset: s; margin: 0 0 22px; padding: 14px 16px; border-radius: 14px; background: var(--a-surface-2); border: 1px dashed var(--a-border); display: grid; gap: 8px; font-size: 13.5px; }
.auth-steps li { counter-increment: s; display: flex; gap: 10px; align-items: center; }
.auth-steps li::before {
  content: counter(s); flex: 0 0 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--a-primary), var(--a-primary-2));
}

.hint { font-size: 12.5px; color: var(--a-muted); margin-top: 6px; }

/* ---------- Tema ---------- */
.auth-theme {
  position: absolute; top: 18px; right: 18px;
  width: 42px; height: 42px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--a-border); background: var(--a-surface); color: var(--a-text);
  display: grid; place-items: center; font-size: 20px; box-shadow: var(--a-shadow);
}
.auth-theme:hover { color: var(--a-primary); }
.auth-theme .i-dark { display: none; }
html[data-mode="dark"] .auth-theme .i-light { display: none; }
html[data-mode="dark"] .auth-theme .i-dark { display: inline; }

.auth-foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--a-muted); }
.auth-foot a { color: var(--a-muted); text-decoration: underline; }

/* ---------- Responsivo ---------- */
@media (max-width: 920px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: block; }
  .auth-main { align-items: flex-start; padding-top: 70px; }
  .auth-card { padding: 28px 22px 24px; }
}
