/* ============================================================
   VIP ID — tela de login / consentimento
   Design limpo, corporativo, claro/escuro. pt-BR.
   ============================================================ */

:root {
  --bg: #eef1f6;
  --bg-grad-1: #e7ecf5;
  --bg-grad-2: #eef1f6;
  --card: #ffffff;
  --card-border: #e3e7ee;
  --text: #1f2733;
  --text-muted: #667085;
  --text-faint: #98a2b3;
  --accent: #1d4ed8;
  --accent-hover: #1740b0;
  --accent-soft: #eef2ff;
  --danger: #b42318;
  --line: #eaecf0;
  --chip: #f5f7fa;
  --shadow: 0 10px 40px rgba(16, 24, 40, 0.10), 0 2px 6px rgba(16, 24, 40, 0.06);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111b;
    --bg-grad-1: #0e1524;
    --bg-grad-2: #0b0f18;
    --card: #141b28;
    --card-border: #243044;
    --text: #e7ecf3;
    --text-muted: #9aa7ba;
    --text-faint: #6b7789;
    --accent: #4d7cff;
    --accent-hover: #6b92ff;
    --accent-soft: #1a2439;
    --danger: #f97066;
    --line: #223044;
    --chip: #1a2333;
    --shadow: 0 14px 50px rgba(0, 0, 0, 0.55);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--bg-grad-1), transparent 70%),
    var(--bg-grad-2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

/* ---- Wordmark ---- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-bottom: 22px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.35);
}
.brand-word {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.brand-word b { font-weight: 800; }
.brand-word span { color: var(--text-muted); font-weight: 600; }

/* ---- Card ---- */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 32px 26px;
}
.card.wide { max-width: 460px; }

.title {
  font-size: 21px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: -0.2px;
}
.subtitle {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 22px;
  line-height: 1.5;
}

/* ---- Client identity (consent) ---- */
.client-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.client-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--card-border);
  background: var(--chip);
}
.client-logo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  background: linear-gradient(135deg, #6d28d9, var(--accent));
}
.client-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  line-height: 1.4;
}
.client-title b { color: var(--text); }

/* ---- Logged user row ---- */
.user-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--chip);
  margin-bottom: 20px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
}
.user-meta { min-width: 0; flex: 1; }
.user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switch-user {
  font-size: 12px;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
}
.switch-user:hover { text-decoration: underline; }

/* ---- Scope list ---- */
.scopes-label {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 6px 2px 10px;
}
.scopes { list-style: none; margin: 0 0 22px; padding: 0; }
.scope {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.scope:last-child { border-bottom: 1px solid var(--line); }
.scope-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.scope-icon svg { width: 17px; height: 17px; }
.scope-text { min-width: 0; }
.scope-name { font-size: 14px; font-weight: 600; }
.scope-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; margin-top: 1px; }

/* ---- Buttons ---- */
.actions { display: flex; gap: 10px; margin-top: 4px; }
.btn {
  flex: 1;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--text-muted); border-color: var(--card-border); }
.btn-secondary:hover { background: var(--chip); }

/* ---- Google button holder ---- */
.gbtn-wrap {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin: 8px 0 6px;
}

/* ---- Footer / misc ---- */
.foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.5;
}
.foot a { color: var(--text-muted); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

.err {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 16px;
}

/* ---- Error page ---- */
.error-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(180, 35, 24, 0.10);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.error-icon svg { width: 26px; height: 26px; }

/* ---- Home ---- */
.home-lead { font-size: 14px; color: var(--text-muted); text-align: center; line-height: 1.6; margin: 0 0 20px; }
.home-list { list-style: none; padding: 0; margin: 0 0 8px; }
.home-list li { display: flex; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 0; border-top: 1px solid var(--line); color: var(--text-muted); }
.home-list li code { background: var(--chip); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; color: var(--text); }

@media (max-width: 480px) {
  .card { padding: 26px 20px 22px; }
}
