/* ============================================================
   login.css — Tela de login + Painel Admin
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  min-height: 100vh;
  background: #0f172a;
  color: #111827;
}

/* ===== Tela de Login ===== */
.login-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Painel esquerdo (decorativo) */
.login-side {
  width: 42%;
  background: linear-gradient(145deg, #374151 0%, #4b5563 40%, #1f2937 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 56px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Padrão de pontos decorativos */
.login-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Círculos decorativos */
.login-side::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -80px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.08);
  pointer-events: none;
}

.login-deco-circle {
  position: absolute;
  top: -60px;
  left: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.07);
  pointer-events: none;
}

.login-brand-logo {
  font-size: 3.2rem;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.3));
}

.login-brand-logo img {
  width: 260px;
  height: 120px;
  object-fit: contain;
  display: block;
}

.login-brand-name {
  font-size: 2.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}

.login-brand-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.65);
  margin-top: 10px;
  font-weight: 400;
  position: relative;
  z-index: 1;
  line-height: 1.5;
}

.login-features {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
}

.login-feature-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

/* Painel direito (formulário) */
.login-main {
  flex: 1;
  background: #f8faff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 40px;
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.login-card-sub {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 36px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.02em;
}

.field-group input {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  color: #0f172a;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.field-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.field-group input::placeholder { color: #94a3b8; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 42px; }

.toggle-pass {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: #94a3b8;
  padding: 2px;
  transition: color 0.2s;
}
.toggle-pass:hover { color: #2563eb; }

.login-error {
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.2);
  color: #dc2626;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.82rem;
  font-weight: 500;
}

.btn-login {
  padding: 12px 24px;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  transition: box-shadow 0.2s, transform 0.1s;
  width: 100%;
  letter-spacing: 0.02em;
}
.btn-login:hover { box-shadow: 0 6px 22px rgba(37,99,235,0.48); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }

.login-footer {
  margin-top: 32px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
}

@media (max-width: 768px) {
  .login-side { display: none; }
  .login-main { background: #fff; }
}

/* ===== Painel Admin ===== */
.admin-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-sub { font-size: 0.85rem; color: #6b7280; margin-top: 3px; }

/* Tabela de usuários */
.user-table-wrap {
  background: var(--bg-card, #fff);
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.2);
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  overflow: hidden;
  margin-bottom: 24px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.user-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #6b7280;
  background: rgba(148,163,184,0.07);
  border-bottom: 1px solid rgba(148,163,184,0.15);
}

.user-table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
  color: var(--text, #111827);
  vertical-align: middle;
}

.user-table tr:last-child td { border-bottom: none; }
.user-table tr:hover td { background: rgba(37,99,235,0.03); }

.user-acesso-tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 4px;
  background: rgba(37,99,235,0.1);
  color: #2563eb;
}

.user-role-tag {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-role-tag.admin { background: rgba(37,99,235,0.1);  color: #2563eb; }
.user-role-tag.user  { background: rgba(22,163,74,0.1);  color: #16a34a; }

.btn-del {
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(220,38,38,0.3);
  color: #dc2626;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-family: inherit;
  transition: background 0.2s;
}
.btn-del:hover { background: rgba(220,38,38,0.08); }

/* Formulário de adição */
.add-user-card {
  background: var(--bg-card, #fff);
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.2);
  box-shadow: 0 4px 20px rgba(15,23,42,0.07);
  padding: 22px 24px;
}

.add-user-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text, #111827);
}

.add-user-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.add-user-form .field-group { gap: 5px; }

.add-user-form input,
.add-user-form select {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1.5px solid rgba(148,163,184,0.5);
  background: var(--bg, #f8faff);
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text, #111827);
  transition: border-color 0.2s;
  width: 100%;
}

.add-user-form input:focus,
.add-user-form select:focus { outline: none; border-color: #2563eb; }

.acesso-checks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.acesso-checks label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--text, #111827);
  cursor: pointer;
  font-weight: 500;
}

.btn-add {
  padding: 9px 20px;
  border-radius: 9px;
  background: #2563eb;
  color: #fff;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(37,99,235,0.28);
  transition: box-shadow 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-add:hover { box-shadow: 0 5px 16px rgba(37,99,235,0.4); transform: translateY(-1px); }

.admin-notice {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 9px;
  font-size: 0.78rem;
  color: #92400e;
}

:root.dark .admin-notice { color: #fcd34d; background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.2); }
