/* =========================================================
   Página de Status do Grupo INDEXBrasil / iBry
   Reaproveita o cabeçalho e o rodapé enxutos da página de login
   ========================================================= */

/* Cores de estado */
:root {
  --st-ok: #16a34a;
  --st-ok-soft: #e7f7ec;
  --st-degraded: #e29b00;
  --st-degraded-soft: #fff7e6;
  --st-down: #dc2626;
  --st-down-soft: #fdecec;
  --st-maint: #2f6be0;
  --st-maint-soft: #e7f0fe;
}

/* ---------------- Banner geral ---------------- */
.status-banner {
  margin: 40px 0 8px;
  border-radius: var(--radius);
  padding: 26px 30px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: linear-gradient(120deg, #16a34a, #0f9d63);
  color: #fff;
  box-shadow: 0 20px 40px -24px rgba(22, 163, 74, .6);
}
.status-banner.is-degraded { background: linear-gradient(120deg, #e29b00, #d68a00); box-shadow: 0 20px 40px -24px rgba(226, 155, 0, .55); }
.status-banner.is-down { background: linear-gradient(120deg, #dc2626, #c01d1d); box-shadow: 0 20px 40px -24px rgba(220, 38, 38, .55); }
.status-banner__icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18);
}
.status-banner__icon svg { width: 28px; height: 28px; }
.status-banner__text h1 { font-family: var(--font-head); font-size: clamp(22px, 3vw, 30px); font-weight: 800; line-height: 1.1; margin: 0 0 4px; color: #fff; }
.status-banner__text p { margin: 0; font-size: 14.5px; opacity: .92; color: #fff; }

.status-updated {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin: 16px 2px 0; font-size: 13px; color: var(--muted);
}
.status-updated b { color: var(--ink); font-weight: 600; }

/* ---------------- Legenda ---------------- */
.status-legend {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  margin: 26px 2px 10px; font-size: 13px; color: var(--body);
}
.status-legend span { display: inline-flex; align-items: center; gap: 7px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.status-dot--ok { background: var(--st-ok); }
.status-dot--degraded { background: var(--st-degraded); }
.status-dot--down { background: var(--st-down); }
.status-dot--maint { background: var(--st-maint); }

/* ---------------- Grupos de serviços ---------------- */
.status-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
.status-group__head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-alt);
}
.status-group__title { display: flex; align-items: center; gap: 12px; }
.status-group__title img { height: 26px; width: auto; display: block; }
.status-group__title h2 { font-family: var(--font-head); font-size: 17px; font-weight: 700; color: var(--ink); }
.status-group__title small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }

.status-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.status-item:last-child { border-bottom: 0; }
.status-item__name { font-size: 15px; color: var(--dark); font-weight: 500; }
.status-item__name small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  padding: 6px 12px; border-radius: 999px;
}
.status-pill--ok { color: var(--st-ok); background: var(--st-ok-soft); }
.status-pill--degraded { color: var(--st-degraded); background: var(--st-degraded-soft); }
.status-pill--down { color: var(--st-down); background: var(--st-down-soft); }
.status-pill--maint { color: var(--st-maint); background: var(--st-maint-soft); }
.status-pill .status-dot { width: 8px; height: 8px; }

/* ---------------- Uptime ---------------- */
.status-uptime { padding: 20px 24px 22px; }
.status-uptime__row { margin-bottom: 18px; }
.status-uptime__row:last-child { margin-bottom: 0; }
.status-uptime__label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.status-uptime__label span { font-size: 14px; color: var(--dark); font-weight: 500; }
.status-uptime__label b { font-size: 13.5px; color: var(--st-ok); font-weight: 700; }
.status-bar {
  height: 30px; border-radius: 7px;
  /* segmentos verdes simulando 90 dias operacionais */
  background:
    repeating-linear-gradient(90deg, var(--st-ok) 0 6px, transparent 6px 8px);
  background-color: var(--st-ok-soft);
}
.status-bar.has-degraded {
  background:
    repeating-linear-gradient(90deg, var(--st-ok) 0 6px, transparent 6px 8px);
}
.status-uptime__scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* ---------------- Histórico / manutenções ---------------- */
.status-history {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px 26px; margin-bottom: 20px;
}
.status-history h2 { font-family: var(--font-head); font-size: 18px; color: var(--ink); font-weight: 700; margin-bottom: 6px; }
.status-history > p { font-size: 14.5px; color: var(--body); }
.status-empty {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 16px 18px;
  background: var(--st-ok-soft); border-radius: 12px;
  font-size: 14.5px; color: #14713f;
}
.status-empty svg { width: 22px; height: 22px; flex: 0 0 auto; color: var(--st-ok); }

.status-event { padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.status-event:last-child { border-bottom: 0; padding-bottom: 0; }
.status-event__date { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.status-event__title { font-size: 15.5px; color: var(--dark); font-weight: 600; margin: 4px 0 4px; }
.status-event p { font-size: 14px; color: var(--body); line-height: 1.6; }

/* ---------------- Aviso de assinatura ---------------- */
.status-subscribe {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--st-maint-soft); border: 1px solid var(--blue-tint2);
  border-radius: var(--radius); padding: 20px 26px; margin-bottom: 60px;
}
.status-subscribe p { font-size: 14.5px; color: var(--ink); margin: 0; }
.status-subscribe .btn { white-space: nowrap; }

.status-note { font-size: 12.5px; color: var(--muted); margin: 4px 2px 40px; line-height: 1.6; }

@media (max-width: 640px) {
  .status-banner { flex-direction: row; padding: 20px; }
  .status-item { flex-wrap: wrap; }
}

/* ---------------- Animações ---------------- */
@media (prefers-reduced-motion: no-preference) {

  /* Entrada das seções ao rolar (ativada por JS) */
  .status-animate-ready .status-anim {
    opacity: 0;
    transform: translateY(20px);
  }
  .status-animate-ready .status-anim.in {
    opacity: 1;
    transform: none;
    transition: opacity .6s ease, transform .6s cubic-bezier(.22, 1, .36, 1);
  }

  /* Pulso "ao vivo" no ícone do banner */
  .status-banner__icon { position: relative; }
  .status-banner__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    animation: statusPulse 2.6s ease-out infinite;
  }
  @keyframes statusPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); }
    70%  { box-shadow: 0 0 0 16px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  }

  /* Pulso suave nos indicadores de status dos grupos */
  .status-group__head .status-pill--ok .status-dot {
    animation: statusDot 2s ease-in-out infinite;
  }
  @keyframes statusDot {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
    50%      { opacity: .55; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0); }
  }

  /* Preenchimento animado das barras de disponibilidade quando revelam */
  .status-animate-ready .status-bar {
    background-repeat: no-repeat;
    background-size: 0% 100%;
    transition: background-size 1.1s ease .15s;
  }
  .status-animate-ready .status-anim.in .status-bar {
    background-size: 100% 100%;
  }
}
