/* =========================================================
   BASE
   (reaproveita as variáveis de :root definidas em app.css)
========================================================= */

:root{
  /* Tema CLARO */
  --bg:#f3f4f6;
  --bg-soft:#e5e7eb;
  --fg:#111827;
  --muted:#6b7280;

  --brand:#ffcc00;
  --brand-600:#e6b800;
  --accent:#206696;

  --card:#ffffff;
  --border:#d1d5db;
  --shadow:rgba(15,23,42,.12);

  --sidebar-bg:#ffffff;
  --topbar-bg:#ffffff;
  --table-head-bg:#f3f4f6;
  --input-bg:#ffffff;
  --toast-bg:#ffffff;
  --modal-bg:#ffffff;
}

/* Tema ESCURO */
:root[data-theme="dark"]{
  --bg:#0d0d0d;
  --bg-soft:#101010;
  --fg:#f2f2f2;
  --muted:#cfcfcf;

  --brand:#ffcc00;
  --brand-600:#e6b800;
  --accent:#206696;

  --card:#161616;
  --border:#262626;
  --shadow:rgba(0,0,0,.45);

  --sidebar-bg:#111;
  --topbar-bg:#0f0f0f;
  --table-head-bg:#0f0f0f;
  --input-bg:#111;
  --toast-bg:#101010;
  --modal-bg:#0f0f0f;
}

:root, :root[data-theme="dark"] {
  transition: background .35s ease, color .35s ease;
}
.auth-shell .card {
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease;
}
input, .btn-eye {
  transition: background .35s ease, border-color .35s ease, color .35s ease;
}


* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 10%, var(--bg-soft) 0%, var(--bg) 60%), var(--bg);
  color: var(--fg);
}

/* =========================================================
   SHELL / CARD
========================================================= */

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

/* Escopado para não brigar com .card do app */
.auth-shell .card {
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, rgba(38,102,150,0.07), rgba(38,102,150,0)), var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 20px 60px var(--shadow);
}

/* =========================================================
   BRAND
========================================================= */

.auth-shell .brand {
  text-align: center;
  margin-bottom: 22px;
}

.auth-shell .brand__logo {
  height: 100px;
  width: auto;
  display: inline-block;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
  margin-bottom: 10px;
}

.auth-shell .brand__title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--muted);
}

/* =========================================================
   FORM
========================================================= */

.form { display: grid; gap: 14px; }

.field { display: grid; gap: 6px; }

.field--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

label {
  font-size: .9rem;
  color: var(--muted);
}

/* Inputs de login */

input[type="text"],
input[type="password"],
input[type="email"] {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  width: 100%;
}

input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="email"]::placeholder {
  color: var(--muted);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32,102,150,.25);
}

/* Campo de senha com botão olho */

.password-wrap {
  position: relative;
}

.btn-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-eye:hover {
  border-color: var(--accent);
}

/* =========================================================
   CHECKBOX / LINKS
========================================================= */

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--muted);
}

.checkbox input {
  accent-color: var(--brand);
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-size: .9rem;
}

.link:hover {
  text-decoration: underline;
}

/* =========================================================
   BOTÕES
========================================================= */

/* Se já tiver .btn / .btn--primary no app.css, pode manter igual.
   Aqui está repetido só para o auth ficar independente se precisar. */

.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 12px 16px;
  border-radius: 12px;
  width: 100%;
}

.btn--primary {
  background: var(--brand);
  color: #111;
  box-shadow: 0 8px 20px rgba(255,204,0,0.2);
}

.btn--primary:hover {
  background: var(--brand-600);
}

/* =========================================================
   ALERTA DE ERRO
========================================================= */

.alert {
  border: 1px solid #e53935;
  color: #ffd7d7;
  background: rgba(229,57,53,.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: .92rem;
}

/* =========================================================
   LEGAL / RODAPÉ DE LOGIN
========================================================= */

.legal {
  margin-top: 16px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 480px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-shell .card {
    padding: 22px;
  }
}

.auth-toggle {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 10;
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;
  border: 1px solid var(--border);

  /* Força contraste nos dois temas */
  background: var(--card);
  color: var(--fg);

  transition: background .3s, color .3s, border-color .3s;
}

:root[data-theme="dark"] .auth-toggle {
  background: #1a1a1a;      /* cinza escuro visível */
  color: #ffcc00;           /* ícone bem visível */
  border-color: #3a3a3a;
}

.auth-toggle:hover {
  border-color: var(--accent);
}
