/* =========================================================
   Anti-Fraude - Interface responsiva
   Paleta: branco, azul claro, azul institucional e verde
   ========================================================= */

:root {
  --bg: #f5fbff;
  --bg-soft: #eaf7ff;
  --card: #ffffff;
  --primary: #0f5d8f;
  --primary-strong: #0a456d;
  --primary-soft: #dff2ff;
  --text: #15344b;
  --muted: #6f8799;
  --border: #d7eaf5;
  --success: #1d8b5b;
  --success-soft: #e7f7ef;
  --danger: #c34a55;
  --danger-soft: #fff0f1;
  --shadow: 0 20px 55px rgba(21, 79, 115, 0.14);
  --shadow-soft: 0 10px 30px rgba(21, 79, 115, 0.09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, rgba(110, 201, 255, 0.22), transparent 28%),
    radial-gradient(circle at 88% 84%, rgba(100, 193, 242, 0.15), transparent 30%),
    linear-gradient(145deg, #fbfdff 0%, var(--bg-soft) 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

svg {
  fill: currentColor;
}

/* ------------------------- LOGIN ------------------------- */

.login-page {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.login-page::before {
  width: 320px;
  height: 320px;
  left: -110px;
  bottom: -110px;
  background: rgba(93, 188, 242, 0.12);
}

.login-page::after {
  width: 280px;
  height: 280px;
  right: -90px;
  top: -100px;
  background: rgba(50, 157, 210, 0.10);
}

.login-shell {
  width: min(100%, 1180px);
  min-height: calc(100vh - 58px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 34px 24px;
}

.login-card {
  width: min(100%, 500px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(196, 226, 243, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.brand {
  padding: 32px 38px 10px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(238, 249, 255, 0.82), rgba(255,255,255,0.25));
}

.brand-logo {
  width: min(100%, 390px);
  max-height: 210px;
  object-fit: contain;
  display: block;
  border-radius: 14px;
}

.login-content {
  padding: 16px 44px 44px;
}

.login-content h1 {
  margin: 0;
  text-align: center;
  font-size: clamp(1.55rem, 4vw, 2rem);
  letter-spacing: -0.03em;
  color: var(--primary-strong);
}

.subtitle {
  margin: 8px 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.96rem;
}

.login-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #31556d;
}

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

.input-icon {
  position: absolute;
  left: 15px;
  width: 20px;
  height: 20px;
  color: #75a7c7;
  pointer-events: none;
}

.input-icon svg,
.password-toggle svg {
  width: 100%;
  height: 100%;
}

.input-wrap input {
  width: 100%;
  height: 54px;
  border: 1px solid #cfe4f1;
  border-radius: var(--radius-md);
  background: #fbfdff;
  color: var(--text);
  padding: 0 50px 0 46px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-wrap input::placeholder {
  color: #a2b6c4;
}

.input-wrap input:focus {
  border-color: #68b8e5;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(85, 178, 229, 0.14);
}

.input-wrap input.invalid {
  border-color: #d45a65;
  box-shadow: 0 0 0 4px rgba(212, 90, 101, 0.1);
}

.password-toggle {
  position: absolute;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #76a3bf;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.password-toggle svg {
  width: 21px;
  height: 21px;
}

.login-message {
  min-height: 20px;
  margin: -3px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
}

.login-message.success {
  color: var(--success);
}

.primary-button {
  height: 54px;
  border: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0f669f, #1788c3);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(22, 126, 184, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(22, 126, 184, 0.3);
  filter: saturate(1.07);
}

.primary-button:active {
  transform: translateY(0);
}

.primary-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.primary-button svg {
  width: 20px;
  height: 20px;
}

.page-footer {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 14px 24px;
  color: #7f98a9;
  font-size: 0.82rem;
  text-align: center;
}

/* ---------------------- DASHBOARD ----------------------- */

.dashboard-page {
  background:
    radial-gradient(circle at 0 0, rgba(115, 207, 255, 0.18), transparent 24%),
    linear-gradient(145deg, #f8fcff 0%, #eaf7ff 100%);
}

.dashboard-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(18px, 4vw, 54px);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar-logo {
  width: 190px;
  height: 58px;
  object-fit: cover;
  object-position: center 57%;
  border-radius: 10px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--primary-soft);
  color: var(--primary);
}

.topbar-user-icon svg {
  width: 22px;
  height: 22px;
}

.topbar-user-text {
  display: grid;
  line-height: 1.2;
}

.topbar-user-text strong {
  font-size: 0.94rem;
}

.topbar-user-text span {
  margin-top: 3px;
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 700;
}

.logout-button {
  margin-left: 8px;
  border: 1px solid #cfe5f2;
  background: #fff;
  color: var(--primary);
  border-radius: 11px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.logout-button:hover {
  background: #eef8fe;
  border-color: #9ecce7;
}

.dashboard-content {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 42px 24px 52px;
  flex: 1;
}

.welcome-card {
  border: 1px solid #cfe6f3;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 94% 18%, rgba(84, 187, 235, 0.26), transparent 28%),
    linear-gradient(135deg, #ffffff 0%, #f3fbff 100%);
  box-shadow: var(--shadow-soft);
  padding: clamp(26px, 5vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  color: #2782b5;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.welcome-card h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.045em;
  color: var(--primary-strong);
}

.welcome-card p {
  max-width: 670px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.welcome-shield {
  flex: 0 0 auto;
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
  border-radius: 26px;
  color: #1c8a5a;
  background: linear-gradient(135deg, #e6f8ef, #e6f4fd);
  box-shadow: inset 0 0 0 1px rgba(71, 173, 133, 0.18);
}

.welcome-shield svg {
  width: 51px;
  height: 51px;
}

.summary-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 126px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.summary-icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
}

.summary-icon svg {
  width: 30px;
  height: 30px;
}

.active-summary .summary-icon {
  background: var(--success-soft);
  color: var(--success);
}

.disabled-summary .summary-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.summary-card > div:last-child {
  display: grid;
  gap: 2px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.summary-card strong {
  color: var(--primary-strong);
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.users-panel {
  margin-top: 24px;
  padding: 26px;
  background: rgba(255,255,255,0.94);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-heading h2 {
  margin: 0;
  color: var(--primary-strong);
  font-size: 1.28rem;
}

.panel-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.status-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #7892a4;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(29,139,91,0.12);
}

.user-grid {
  display: grid;
  gap: 14px;
}

.user-card {
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border: 1px solid #dcebf4;
  border-radius: 18px;
  background: #fbfdff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.user-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(19, 82, 120, 0.08);
  border-color: #bddced;
}

.user-card.disabled {
  opacity: 0.78;
  background: #fafbfc;
}

.user-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #e8f6ff;
  color: #1675aa;
}

.user-avatar svg {
  width: 27px;
  height: 27px;
}

.disabled .user-avatar {
  background: #edf0f3;
  color: #8797a3;
}

.state-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: var(--success);
}

.disabled .state-dot {
  background: #a6b1ba;
}

.user-info h3 {
  margin: 0;
  font-size: 1rem;
  color: #24485f;
}

.user-info p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 132px;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.status-badge svg {
  width: 16px;
  height: 16px;
}

.enabled-badge {
  color: #18764e;
  background: var(--success-soft);
  border: 1px solid #c8ecd9;
}

.disabled-badge {
  color: #9a4650;
  background: var(--danger-soft);
  border: 1px solid #f2ccd0;
}

.dashboard-footer {
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
  color: #7b94a5;
  text-align: center;
  padding: 18px 24px;
  font-size: 0.8rem;
}

/* ---------------------- RESPONSIVO ---------------------- */

@media (max-width: 720px) {
  .login-shell {
    padding: 20px 14px;
  }

  .login-card {
    border-radius: 22px;
  }

  .brand {
    padding: 24px 24px 8px;
  }

  .brand-logo {
    max-height: 170px;
  }

  .login-content {
    padding: 14px 24px 30px;
  }

  .topbar {
    min-height: 70px;
    padding: 8px 14px;
  }

  .topbar-logo {
    width: 126px;
    height: 46px;
  }

  .topbar-user-text {
    display: none;
  }

  .topbar-user-icon {
    display: none;
  }

  .logout-button {
    margin-left: 0;
  }

  .dashboard-content {
    padding: 26px 14px 38px;
  }

  .welcome-card {
    align-items: flex-start;
  }

  .welcome-shield {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }

  .welcome-shield svg {
    width: 36px;
    height: 36px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .users-panel {
    padding: 18px 14px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .user-card {
    grid-template-columns: auto 1fr;
  }

  .status-badge {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

@media (max-width: 470px) {
  .welcome-card {
    display: block;
  }

  .welcome-shield {
    margin-top: 22px;
  }

  .panel-heading {
    display: block;
  }

  .status-legend {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
