* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  color: #0f172a;
  background: #f1f5f9;
  overflow: hidden;
}

/* —— Layout split —— */
.auth-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  animation: auth-enter 0.5s ease-out;
}

@keyframes auth-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* —— Painel esquerdo (marca) —— */
.auth-brand {
  flex: 1 1 48%;
  max-width: 560px;
  background: #062a45;
  color: #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 0 24px 24px 0;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-brand-logo {
  max-height: 420px;
  max-width: min(1020px, 88%);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto 1.75rem;
}

.auth-brand-product {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  letter-spacing: -0.03em;
  color: #f8fafc;
}

.auth-brand-tagline {
  margin: 0 auto 2rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #bae6fd;
  max-width: 340px;
}

.auth-brand-features {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  max-width: 300px;
}

.auth-brand-features li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: #e0f2fe;
  width: 100%;
}

.auth-brand-features i {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: transparent;
  color: #7dd3fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.auth-brand-footer {
  position: relative;
  z-index: 1;
  margin: 2rem 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* —— Painel direito (formulário) —— */
.auth-main {
  flex: 1 1 52%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: #f8fafc;
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
}

.auth-form-header {
  margin-bottom: 2rem;
  text-align: center;
}

.auth-brand-product i,
.auth-brand-footer i {
  margin-right: 0.35rem;
  opacity: 0.9;
}

.field label i {
  color: var(--vga-primary, #0d4f8b);
  font-size: 0.85rem;
}

.auth-title {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  margin: 0;
  font-size: 0.92rem;
  color: #64748b;
  line-height: 1.5;
}

.auth-card.is-setup #panelLogin,
.auth-layout.is-setup #panelLogin {
  display: none !important;
}

.auth-panel[hidden] {
  display: none !important;
}

/* —— Formulário —— */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.field label {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.45rem;
}

.field-hint {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.72rem;
}

.field-input {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 0.9rem;
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s;
}

.field-input input,
.field-input select {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 2.6rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.field-input select {
  appearance: none;
  cursor: pointer;
}

.field-input input::placeholder {
  color: #94a3b8;
}

.field-input input:hover,
.field-input select:hover {
  border-color: #cbd5e1;
}

.field-input input:focus,
.field-input select:focus {
  outline: none;
  border-color: var(--vga-accent, #00a8e8);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.18);
}

.field-input:focus-within .field-icon {
  color: var(--vga-primary, #0d4f8b);
}

.field-toggle {
  position: absolute;
  right: 0.55rem;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.35rem;
  font-size: 1.05rem;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.field-toggle:hover {
  color: #64748b;
  background: #f1f5f9;
}

.field-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: -0.25rem 0 0;
  cursor: pointer;
  user-select: none;
  font-size: 0.84rem;
  color: #475569;
}

.field-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--vga-primary, #0d4f8b);
  cursor: pointer;
  flex-shrink: 0;
}

.field-remember span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.field-remember span i {
  font-size: 0.9rem;
  color: var(--vga-primary, #0d4f8b);
}

/* —— Alertas —— */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.form-alert[hidden] { display: none !important; }

.form-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.form-alert i {
  flex-shrink: 0;
  margin-top: 0.12rem;
}

/* —— Botão —— */
.btn-auth {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d4f8b 0%, #1a6bb5 55%, #00a8e8 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 79, 139, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn-auth:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 6px 20px rgba(13, 79, 139, 0.42);
  transform: translateY(-1px);
}

.btn-auth:active:not(:disabled) {
  transform: translateY(0);
}

.btn-auth:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.btn-auth.is-loading .btn-auth-text { display: none; }
.btn-auth.is-loading .btn-auth-loading {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.spin {
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* —— Versão —— */
.auth-version {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.45;
  white-space: nowrap;
  text-align: center;
}

/* —— Responsivo —— */
@media (max-width: 900px) {
  .auth-layout {
    flex-direction: column;
    overflow-y: auto;
  }

  .auth-brand {
    max-width: none;
    flex: none;
    padding: 1.75rem 1.5rem;
    min-height: auto;
  }

  .auth-brand-features {
    display: none;
  }

  .auth-brand-tagline {
    margin-bottom: 0;
    font-size: 0.88rem;
  }

  .auth-brand-footer {
    margin-top: 1.25rem;
  }

  .auth-main {
    padding: 1.5rem 1.25rem 2rem;
  }

  .auth-form-header {
    margin-bottom: 1.5rem;
  }

  .auth-title {
    font-size: 1.4rem;
  }
}
