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

:root {
  --blue:      #1a5ca8;
  --blue-dark: #134a8a;
  --green:     #4a9c3a;
  --gray-bg:   #f0f4f8;
  --gray-border: #d1d9e0;
  --text:      #2c3e50;
  --text-light:#6b7a8d;
  --error:     #d93025;
  --radius:    12px;
  --shadow:    0 8px 32px rgba(26, 92, 168, 0.15);
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Login ── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f0fb 0%, #f0f4f8 60%, #eaf4e8 100%);
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 400px;
}

/* Logo */
.logo-area {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.logo {
  width: 180px;
  height: auto;
  object-fit: contain;
}

/* Inputs */
.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.field-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-border);
  border-radius: 8px;
  font-size: 15px;
  color: var(--text);
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.field-group input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 92, 168, 0.1);
  background: #fff;
}

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

/* Error */
.error-msg {
  background: #fdecea;
  border: 1px solid #f5c6c2;
  border-radius: 8px;
  color: var(--error);
  font-size: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

/* Button */
.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s, transform 0.1s;
  margin-top: 8px;
}

.btn-login:hover:not(:disabled) {
  background: var(--blue-dark);
}

.btn-login:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Skeleton Loading ── */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.sk {
  background: #e2e8f0;
  background-image: linear-gradient(
    90deg,
    #e2e8f0 0px,
    #f0f4f8 40%,
    #e2e8f0 80%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 6px;
}

/* Skeleton overlay — cobre o conteúdo real até a página estar pronta */
.skeleton-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8f0fb 0%, #f0f4f8 60%, #eaf4e8 100%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.skeleton-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Conteúdo real começa invisível e faz fade-in */
.page-content {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.page-content.visible {
  opacity: 1;
}

/* ── Skeleton: Login ── */
.sk-login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px 40px;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.sk-logo   { width: 180px; height: 90px;  margin-bottom: 36px; border-radius: 8px; }
.sk-label  { width: 60px;  height: 12px; margin-bottom: 6px; align-self: flex-start; }
.sk-input  { width: 100%;  height: 46px; margin-bottom: 20px; border-radius: 8px; }
.sk-btn    { width: 100%;  height: 50px; margin-top: 8px; border-radius: 8px; }

/* ── Skeleton: Dashboard ── */
.sk-dashboard {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: #fff;
}

.sk-success-text { width: 140px; height: 38px; border-radius: 6px; }

/* ── Responsivo: Login ── */
@media (max-width: 480px) {
  .login-card {
    padding: 32px 20px 28px;
  }

  .logo { width: 140px; }

  .logo-area { margin-bottom: 24px; }
}

/* ── Dashboard ── */
.dashboard-body {
  background: #fff;
}

.success-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-text {
  font-size: 32px;
  font-weight: 600;
  color: var(--green);
}

/* ── Recuperação de Senha ── */
.recover-hint {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}

.recover-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
}

.recover-success-icon {
  width: 48px;
  height: 48px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.recover-success p {
  font-size: 14px;
  color: #15803d;
  line-height: 1.6;
}

.recover-back {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
}

.recover-back a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.recover-back a:hover { text-decoration: underline; }

.forgot-link {
  display: block;
  text-align: right;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.15s;
}

.forgot-link:hover { color: var(--blue); }
