:root {
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, .92);
  --surface-solid: #ffffff;
  --border: rgba(14, 43, 82, .075);
  --text: #0a1f43;
  --muted: #718096;
  --blue: #1677ff;
  --shadow: 0 10px 30px rgba(21, 54, 99, .075);
  --shadow-hover: 0 14px 38px rgba(21, 54, 99, .12);

  --bg-top: #fbfdff;
  --bg-bottom: #eef3f9;
  --bg-radial: rgba(17, 132, 255, .12);
  --grid-line: rgba(17, 63, 118, .018);
  --glow-one: rgba(0, 128, 255, .18);
  --glow-two: rgba(51, 94, 214, .13);

  --btn-border: rgba(14, 43, 82, .08);
  --btn-bg: rgba(255, 255, 255, .72);
  --btn-bg-hover: #fff;
  --btn-text: #315274;
  --btn-shadow: 0 5px 16px rgba(23, 57, 100, .055);
  --btn-shadow-hover: 0 8px 22px rgba(23, 57, 100, .09);

  --logo-bg: rgba(255,255,255,.82);
  --logo-border: rgba(25, 78, 143, .07);
  --logo-shadow: 0 12px 34px rgba(18, 69, 133, .09);

  --handle: #56708e;
  --surface-hover: #fff;
  --focus-ring: rgba(22,119,255,.25);
  --icon-base: #f5f9ff;
  --icon-mix: 11%;
  --arrow-text: #395a7e;
  --arrow-bg: #f1f5fa;
  --footer-text: #8090a3;
  --footer-mark: #536a85;
  --toast-bg: #0a1f43;
  --toast-text: #fff;
  --toast-shadow: 0 8px 24px rgba(5, 24, 51, .2);
}

/* Tema escuro automático (segue o sistema) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #081126;
    --surface: #0d1a38;
    --surface-solid: #0d1a38;
    --border: rgba(148, 178, 228, .12);
    --text: #e8eefb;
    --muted: #9aaccb;
    --blue: #4c9aff;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-hover: 0 14px 38px rgba(0, 0, 0, .5);

    --bg-top: #0a1530;
    --bg-bottom: #060d1e;
    --bg-radial: rgba(52, 140, 255, .16);
    --grid-line: rgba(148, 178, 228, .035);
    --glow-one: rgba(0, 128, 255, .16);
    --glow-two: rgba(80, 110, 230, .14);

    --btn-border: rgba(148, 178, 228, .14);
    --btn-bg: rgba(13, 26, 56, .8);
    --btn-bg-hover: #13234a;
    --btn-text: #c3d3ef;
    --btn-shadow: 0 5px 16px rgba(0, 0, 0, .3);
    --btn-shadow-hover: 0 8px 22px rgba(0, 0, 0, .45);

    --logo-bg: transparent;
    --logo-border: transparent;
    --logo-shadow: none;

    --handle: #9fb6d8;
    --surface-hover: #12224a;
    --focus-ring: rgba(76,154,255,.4);
    --icon-base: #0d1a38;
    --icon-mix: 22%;
    --arrow-text: #c3d3ef;
    --arrow-bg: #16264d;
    --footer-text: #7f93b3;
    --footer-mark: #a9bbd8;
    --toast-bg: #e8eefb;
    --toast-text: #081126;
    --toast-shadow: 0 8px 24px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -8%, var(--bg-radial), transparent 34%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 54%, var(--bg-bottom) 100%);
  background-color: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 68%);
}

.background-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
  opacity: .45;
}

.glow-one {
  top: 22%;
  left: -240px;
  background: var(--glow-one);
}

.glow-two {
  right: -250px;
  bottom: 12%;
  background: var(--glow-two);
}

.portal {
  position: relative;
  z-index: 1;
  width: min(100% - 32px, 540px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 0 max(26px, env(safe-area-inset-bottom));
}

.top-actions {
  height: 42px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--btn-border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--btn-bg);
  color: var(--btn-text);
  box-shadow: var(--btn-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.icon-button svg { width: 18px; height: 18px; }
.icon-button:hover { transform: translateY(-1px); background: var(--btn-bg-hover); box-shadow: var(--btn-shadow-hover); }
.icon-button:active { transform: scale(.96); }

.profile {
  text-align: center;
  padding: 5px 14px 29px;
}

.logo-wrap {
  width: 104px;
  height: 104px;
  margin: 0 auto 15px;
  display: grid;
  place-items: center;
  border-radius: 31px;
  background: var(--logo-bg);
  border: 1px solid var(--logo-border);
  box-shadow: var(--logo-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand-icon {
  width: 82px;
  height: 82px;
  object-fit: contain;
  display: block;
}

h1 {
  margin: 0;
  font-size: clamp(31px, 9vw, 40px);
  line-height: 1.05;
  letter-spacing: -.045em;
  font-weight: 780;
}

.handle {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--handle);
  letter-spacing: .015em;
}

.intro {
  margin: 13px auto 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.services {
  display: grid;
  gap: 13px;
}

.service-link {
  --accent: #1677ff;
  min-height: 78px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 34px;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.service-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--border));
  background: var(--surface-hover);
}

.service-link:active { transform: scale(.992); }

.service-link:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) var(--icon-mix), var(--icon-base));
}

.service-icon svg { width: 26px; height: 26px; }

.service-content { min-width: 0; }

.service-name {
  display: block;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -.018em;
  font-weight: 730;
}

.service-description {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--muted);
}

.service-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--arrow-text);
  background: var(--arrow-bg);
}

.service-arrow svg { width: 16px; height: 16px; }

.footer {
  padding: 34px 0 4px;
  text-align: center;
  color: var(--footer-text);
}

.footer-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--footer-mark);
  font-size: 12px;
  font-weight: 720;
}

.footer-mark img {
  width: 23px;
  height: 23px;
  object-fit: contain;
}

.footer p {
  margin: 4px 0 0;
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 10px 15px;
  border-radius: 999px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 12px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: var(--toast-shadow);
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .portal { padding-top: 34px; }
  .profile { padding-top: 1px; padding-bottom: 31px; }
  .services { gap: 14px; }
  .service-link { min-height: 82px; padding: 13px 14px; }
}

@media (max-width: 380px) {
  .portal { width: min(100% - 22px, 540px); }
  .profile { padding-left: 8px; padding-right: 8px; }
  .service-link { grid-template-columns: 48px minmax(0, 1fr) 30px; gap: 11px; border-radius: 20px; }
  .service-icon { width: 48px; height: 48px; border-radius: 15px; }
  .service-arrow { width: 30px; height: 30px; }
}

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



/* =====================================================
   JFGESTÃO - LOGO OFICIAL DO PORTAL
   ===================================================== */

.logo-wrap {
  width: min(300px, 82vw);
  height: auto;
  min-height: 92px;
  margin: 0 auto 14px;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
}

.logo-wrap picture { display: contents; }

.brand-logo {
  display: block;
  width: 100%;
  max-width: 265px;
  height: auto;
  object-fit: contain;
}

.footer-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo {
  display: block;
  width: 125px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 520px) {
  .logo-wrap {
    width: min(270px, 86vw);
    min-height: 82px;
    padding: 12px 16px;
  }

  .brand-logo {
    max-width: 235px;
  }
}

@media (prefers-color-scheme: dark) {
  .logo-wrap { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
