/* ==========================================================
   ERP VGA - AUTENTICAÇÃO / LOGIN SPLIT-SCREEN
   Design System VGA Contabilidade
   ========================================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  color: #0f172a;
  background: var(--bg-app, #f1f5f9);
  overflow-x: hidden;
}

/* --- Layout split --- */
.auth-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  animation: auth-enter 0.4s ease-out;
}

@keyframes auth-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Painel esquerdo (marca & destaque institucional) --- */
.auth-brand {
  flex: 1 1 45%;
  max-width: 520px;
  background: #0f172a;
  border-right: 1px solid #1e293b;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.auth-brand::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 380px;
}

.auth-brand-logo {
  max-height: 90px;
  max-width: 260px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.auth-brand-product {
  font-size: 1.85rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-brand-tagline {
  margin: 0 auto 2rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #bae6fd;
  max-width: 320px;
}

.auth-brand-features {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  width: 100%;
  max-width: 320px;
}

.auth-brand-features li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #e0f2fe;
}

.auth-brand-features i {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #7dd3fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.auth-brand-footer {
  position: relative;
  z-index: 1;
  margin: 2.5rem 0 0;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* --- Painel direito (formulário de login) --- */
.auth-main {
  flex: 1 1 55%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  background: #f8fafc;
}

[data-theme="dark"] .auth-main {
  background: #0b1329;
}

.auth-form-wrap {
  width: 100%;
  max-width: 420px;
}

.auth-form-header {
  margin-bottom: 2rem;
  text-align: left;
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: #0f172a;
  letter-spacing: -0.03em;
}

[data-theme="dark"] .auth-title {
  color: #f8fafc;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
}

/* --- Formulário --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
}

.field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.45rem;
}

[data-theme="dark"] .field label {
  color: #cbd5e1;
}

.field label i {
  color: var(--vga-primary, #0d4f8b);
  font-size: 0.9rem;
}

.field-input {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 0.95rem;
  color: #94a3b8;
  font-size: 1.05rem;
  pointer-events: none;
  transition: color 0.2s;
}

.field-input input {
  width: 100%;
  padding: 0.8rem 2.6rem 0.8rem 2.6rem;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

[data-theme="dark"] .field-input input {
  background: #132238;
  border-color: #23354e;
  color: #f8fafc;
}

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

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

.field-input:focus-within .field-icon {
  color: #2563eb;
}

.field-toggle {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  font-size: 1.1rem;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.field-toggle:hover {
  color: #475569;
  background: #f1f5f9;
}

[data-theme="dark"] .field-toggle:hover {
  color: #f1f5f9;
  background: #1e293b;
}

.btn-auth {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.78rem 1rem;
  border: 1px solid #1e293b;
  border-radius: 8px;
  background: #1e293b;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: background-color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-auth:hover:not(:disabled) {
  background: #334155;
  border-color: #334155;
}

.btn-auth:active:not(:disabled) {
  transform: translateY(0);
}

/* --- Demonstração --- */
.demo-accounts {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border, #e2e8f0);
}

.demo-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  text-align: center;
}

.demo-btn-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.demo-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  color: #1e293b;
  font-family: inherit;
}

[data-theme="dark"] .demo-btn {
  background: #132238;
  border-color: #23354e;
  color: #f8fafc;
}

.demo-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

[data-theme="dark"] .demo-btn:hover {
  background: #1e3352;
}

.demo-btn-label {
  font-weight: 600;
}

.demo-badge {
  background: rgba(13, 79, 139, 0.1);
  color: #0d4f8b;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

[data-theme="dark"] .demo-badge {
  background: rgba(0, 168, 232, 0.2);
  color: #38bdf8;
}

.auth-version {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* --- Responsividade --- */
@media (max-width: 900px) {
  .auth-layout {
    flex-direction: column;
  }
  .auth-brand {
    max-width: none;
    flex: none;
    padding: 2.5rem 1.5rem;
  }
  .auth-brand-features {
    display: none;
  }
  .auth-brand-tagline {
    margin-bottom: 0.5rem;
  }
  .auth-main {
    padding: 2rem 1.5rem;
  }
}
