/* ═══════════════════════════════════════════════════════════════════════════
   portal.css — Portal Integrado de Sistemas (Suite Central)
   Login unificado + cartões dos módulos. Sem build: CSS puro.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --pt-bg:        #F9FAFB;
  --pt-surface:   #FFFFFF;
  --pt-border:    #E5E7EB;
  --pt-ink:       #111827;
  --pt-ink-soft:  #374151;
  --pt-muted:     #6B7280;
  --pt-faint:     #9CA3AF;
  --pt-dark:      #1F2937;
  --pt-danger:    #DC2626;
  --pt-ok:        #059669;
  --pt-warn:      #F2C800;
  --pt-gradient:  linear-gradient(135deg, #1F2937 0%, #374151 60%, #4B5563 100%);
  --pt-dots:      radial-gradient(rgba(255,255,255,.06) 2px, transparent 2px);
  --pt-flip:      .6s;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--pt-bg);
  color: var(--pt-ink);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

a { color: var(--pt-ink-soft); text-decoration: none; }
a:hover { color: var(--pt-ink); }

@keyframes pt-spin { to { transform: rotate(360deg); } }
@keyframes pt-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pt-shell { position: relative; width: 100%; min-height: 100vh; }
.pt-hidden { display: none !important; }

/* ── Login ───────────────────────────────────────────────────────────────── */

.pt-login {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: var(--pt-gradient);
  overflow: hidden;
}
.pt-login__dots {
  position: absolute; inset: 0;
  background-image: var(--pt-dots);
  background-size: 60px 60px;
}
.pt-login__card {
  position: relative; z-index: 2;
  width: 360px; max-width: 90vw; padding: 40px 34px;
  background: var(--pt-surface); border-radius: 16px;
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform .12s ease-out;
}
.pt-login__logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--pt-dark); color: #FFF;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem; margin-bottom: 20px;
  overflow: hidden;
}
.pt-login__logo img { width: 100%; height: 100%; object-fit: contain; }
.pt-login h1 { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; }
.pt-login__sub { margin: 0 0 26px; font-size: .875rem; color: var(--pt-muted); }

.pt-form { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.pt-input {
  width: 100%; padding: 12px 15px; border-radius: 8px;
  border: 1px solid var(--pt-border); background: var(--pt-bg);
  font-size: .875rem; color: var(--pt-ink); font-family: inherit;
}
.pt-input:focus { outline: none; border-color: var(--pt-dark); background: #FFF; }

.pt-btn {
  width: 100%; padding: 13px; border: none; border-radius: 8px;
  background: var(--pt-dark); color: #FFF; font-weight: 600; font-size: .9rem;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.pt-btn:hover:not(:disabled) { background: #111827; }
.pt-btn:disabled { opacity: .65; cursor: progress; }

.pt-note { margin: 16px 0 0; font-size: .72rem; color: var(--pt-faint); }
.pt-error {
  width: 100%; margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
  background: #FEE2E2; border: 1px solid #FECACA; color: #991B1B;
  font-size: .8rem; text-align: left; animation: pt-fade .2s ease-out;
}

/* ── Cabeçalho ───────────────────────────────────────────────────────────── */

.pt-hero {
  position: relative; background: var(--pt-gradient); color: #FFF;
  padding: 80px 32px 64px; text-align: center; overflow: hidden;
}
.pt-hero__dots {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.045) 2px, transparent 2px);
  background-size: 60px 60px;
}
.pt-hero__inner { position: relative; max-width: 720px; margin: 0 auto; }
.pt-hero__tag {
  display: inline-block; background: rgba(255,255,255,.15);
  font-size: .8rem; padding: .4rem .9rem; border-radius: 999px; margin-bottom: 1rem;
}
.pt-hero h1 { margin: 0 0 12px; font-size: 2.4rem; font-weight: 700; }
.pt-hero p  { margin: 0 0 28px; font-size: 1.05rem; opacity: .8; line-height: 1.6; }
.pt-hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

.pt-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem; border-radius: 8px;
  background: var(--pt-bg); color: var(--pt-dark);
  font-size: .875rem; font-weight: 600;
}
.pt-chip--pending { background: var(--pt-warn); color: #000; }
.pt-chip--session { background: rgba(255,255,255,.15); color: #FFF; font-weight: 500; }
.pt-chip--notif   { background: #FEE2E2; color: var(--pt-danger); font-weight: 600; }
.pt-chip--session.pt-chip--warn { background: var(--pt-warn); color: #000; font-weight: 600; }
.pt-chip--ghost {
  background: transparent; color: #FFF;
  border: 1px solid rgba(255,255,255,.35); cursor: pointer; font-family: inherit;
}
.pt-chip--ghost:hover { background: rgba(255,255,255,.12); }

/* ── Grelha de cartões ───────────────────────────────────────────────────── */

.pt-section { max-width: 1140px; margin: 0 auto; padding: 56px 24px 24px; }
.pt-section__title { margin: 0 0 4px; font-size: 1.1rem; font-weight: 700; text-align: center; }
.pt-section__hint  { margin: 0 0 36px; font-size: .85rem; color: var(--pt-muted); text-align: center; }

.pt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 26px; }
.pt-grid__slot { perspective: 1600px; height: 300px; }

.pt-card {
  position: relative; width: 100%; height: 100%;
  cursor: pointer; outline: none; transform-style: preserve-3d;
  transition: transform var(--pt-flip) cubic-bezier(.4,.2,.2,1);
}
.pt-card.is-flipped { transform: rotateY(180deg); }
.pt-card:focus-visible { outline: 3px solid #2563EB; outline-offset: 4px; }

.pt-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  background: var(--pt-surface); border: 1px solid var(--pt-border);
  border-radius: 16px;
}
.pt-face--front {
  box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
}
.pt-face--back {
  transform: rotateY(180deg); box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: 24px 22px; display: flex; flex-direction: column;
}

.pt-icon {
  position: relative; width: 60px; height: 60px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; margin-bottom: 18px;
}
.pt-icon--sm { width: 34px; height: 34px; border-radius: 10px; font-size: 1rem; margin: 0; flex-shrink: 0; }

/* Sino de notificações — canto superior direito do cartão, fora do ícone,
   para não competir com o badge de pendências que vive colado a ele. */
.pt-bell {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .5rem .2rem .4rem; border-radius: 999px;
  background: #FEE2E2; color: var(--pt-danger);
  font-size: .7rem; font-weight: 700; line-height: 1;
}
.pt-bell i { font-size: .8rem; }
.pt-bell__count { font-variant-numeric: tabular-nums; }

.pt-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--pt-danger); color: #FFF;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--pt-surface);
}

.pt-code { font-size: .72rem; font-weight: 700; letter-spacing: .08em; margin-bottom: 8px; }
.pt-name { font-size: 1.05rem; font-weight: 600; line-height: 1.35; max-width: 230px; }
.pt-flip-hint {
  margin-top: 16px; font-size: .75rem; color: var(--pt-faint);
  display: inline-flex; align-items: center; gap: .35rem;
}

.pt-back__head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pt-back__code { font-size: .68rem; font-weight: 700; letter-spacing: .08em; }
.pt-back__name { font-size: .8rem; font-weight: 600; line-height: 1.2; }

.pt-entries { display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.pt-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-radius: 8px; font-size: .8rem; font-weight: 500;
  background: var(--pt-bg); color: var(--pt-ink-soft);
  border: 1px solid var(--pt-border);
  transition: background .15s, border-color .15s;
}
.pt-entry__label { display: inline-flex; align-items: center; gap: .5rem; }
.pt-entry__count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: #FEE2E2; color: var(--pt-danger);
  font-size: .65rem; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.pt-entries__empty { font-size: .78rem; color: var(--pt-faint); padding: 8px 2px; }

.pt-enter {
  margin-top: auto; width: 100%; padding: 9px 12px; border: none; border-radius: 8px;
  background: var(--pt-dark); color: #FFF; font-size: .8rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
}
.pt-enter:hover { background: #111827; }

/* Cartão-fantasma enquanto os módulos carregam */
.pt-skeleton {
  height: 300px; border-radius: 16px;
  background: linear-gradient(100deg, #F3F4F6 30%, #E9EBEF 50%, #F3F4F6 70%);
  background-size: 300% 100%; animation: pt-shimmer 1.3s linear infinite;
  border: 1px solid var(--pt-border);
}
@keyframes pt-shimmer { to { background-position: -150% 0; } }

.pt-empty {
  grid-column: 1 / -1; text-align: center; padding: 48px 24px;
  background: var(--pt-surface); border: 1px dashed var(--pt-border); border-radius: 16px;
  color: var(--pt-muted); font-size: .9rem;
}

/* ── Estado dos sistemas ─────────────────────────────────────────────────── */

.pt-status { max-width: 1140px; margin: 0 auto; padding: 32px 24px 8px; text-align: center; }
.pt-status h3 {
  margin: 0 0 14px; font-size: .8rem; font-weight: 700; color: var(--pt-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.pt-status__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.pt-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid var(--pt-border); background: var(--pt-surface);
  font-size: .8rem; font-weight: 500; color: var(--pt-ink-soft);
}
.pt-pill i { font-size: .5rem; }
.pt-pill--up   i { color: var(--pt-ok); }
.pt-pill--down i { color: var(--pt-danger); }
.pt-pill--idle i { color: var(--pt-faint); }

/* ── Cartões informativos + rodapé ───────────────────────────────────────── */

.pt-info { max-width: 1140px; margin: 0 auto; padding: 40px 24px 8px; }
.pt-info__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.pt-info__card { border-radius: 12px; padding: 24px; border: 1px solid; }
.pt-info__card i { display: block; font-size: 1.5rem; margin-bottom: 10px; }
.pt-info__card h5 { margin: 0 0 6px; font-size: .9rem; font-weight: 700; }
.pt-info__card p  { margin: 0; font-size: .82rem; line-height: 1.5; color: var(--pt-muted); }
.pt-info__card--blue   { background: #EFF6FF; border-color: #BFDBFE; }
.pt-info__card--blue i { color: #2563EB; }
.pt-info__card--green  { background: #F0FDF4; border-color: #BBF7D0; }
.pt-info__card--green i { color: var(--pt-ok); }
.pt-info__card--amber  { background: #FFF7ED; border-color: #FED7AA; }
.pt-info__card--amber i { color: #D97706; }

.pt-footer {
  background: var(--pt-dark); color: rgba(255,255,255,.6);
  text-align: center; padding: 20px; font-size: .8rem; margin-top: 48px;
}

/* ── Overlay de transição ────────────────────────────────────────────────── */

.pt-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(249,250,251,.85);
}
.pt-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--pt-border); border-top-color: var(--pt-dark);
  animation: pt-spin .7s linear infinite;
}
.pt-spinner--sm { width: 16px; height: 16px; border-width: 2px; border-top-color: #FFF; }

@media (max-width: 600px) {
  .pt-hero { padding: 56px 20px 44px; }
  .pt-hero h1 { font-size: 1.8rem; }
  .pt-section { padding: 40px 18px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .pt-card, .pt-login__card { transition: none; }
  .pt-skeleton { animation: none; }
}
