/* ═══════════════════════════════════════════════════════════════
   status.e-consulters.com.br
   Design system alinhado com zero.e-consulters.com.br
════════════════════════════════════════════════════════════════ */

:root {
  /* Paleta */
  --c-black:     #0a0a0a;
  --c-bg:        #0d0d0d;
  --c-surface:   #141414;
  --c-surface2:  #1a1a1a;
  --c-surface3:  #222222;
  --c-border:    rgba(255,255,255,0.08);
  --c-border-2:  rgba(255,255,255,0.12);
  --c-orange:    #f28a46;
  --c-orange-h:  #ec671b;
  --c-orange-s:  #ff9a56;
  --c-white:     #ffffff;
  --c-text:      #e8e8e8;
  --c-muted:     #888888;
  --c-muted2:    #555555;

  /* Status */
  --ok:      #22c55e;
  --warn:    #eab308;
  --partial: #e87722;
  --down:    #ef4444;
  --maint:   #3b82f6;
  --unknown: #374151;

  /* Gradientes */
  --g-orange: linear-gradient(135deg, #f28a46 0%, #ec671b 100%);
  --g-card:   linear-gradient(135deg, #1a1a1a 0%, #141414 100%);
  --g-hero:   linear-gradient(135deg, #0d0d0d 0%, #1a1005 50%, #0d0d0d 100%);

  /* Tipografia */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Espaçamento */
  --gap-xs: 0.5rem;
  --gap-sm: 1rem;
  --gap-md: 1.5rem;
  --gap-lg: 2.5rem;
  --gap-xl: 4rem;

  /* Raios */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 32px;

  /* Sombras */
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:     0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:     0 16px 64px rgba(0,0,0,0.6);
  --shadow-orange: 0 0 40px rgba(242,138,70,0.15);

  --t-fast:   0.15s ease;
  --t-normal: 0.25s ease;

  --max-w:    960px;
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background-image:
    radial-gradient(1200px 600px at 10% -10%, rgba(242,138,70,0.08), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(242,138,70,0.05), transparent 60%);
}

a { color: var(--c-orange); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-orange-s); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ═══ Header ═══════════════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13,13,13,0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.logo img {
  height: 32px;
  width: auto;
  display: block;
}
.logo-sub {
  font-size: 0.8125rem;
  color: var(--c-muted);
  padding-left: 0.875rem;
  border-left: 1px solid var(--c-border);
  letter-spacing: 0.02em;
}
.report-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  color: var(--c-text);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--t-fast);
  background: var(--c-surface);
}
.report-link:hover {
  border-color: rgba(242,138,70,0.4);
  color: var(--c-orange);
}

/* ═══ Hero de status ═══════════════════════════════════════════ */
.page-head {
  padding: 3rem 0 1rem;
  text-align: center;
}
.page-head .eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--c-orange);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.page-head h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.35rem;
  color: var(--c-white);
}
.page-head p {
  color: var(--c-muted);
  margin: 0;
  font-size: 0.95rem;
}

.overall {
  margin-top: 1.5rem;
  background: var(--g-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: var(--shadow-md), var(--shadow-orange);
  position: relative;
  overflow: hidden;
}
.overall::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}
.overall-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.overall-headline {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-white);
}
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--unknown);
  flex-shrink: 0;
  position: relative;
}
.status-dot.ok    { background: var(--ok);    box-shadow: 0 0 12px rgba(34,197,94,0.7); }
.status-dot.warn  { background: var(--warn);  box-shadow: 0 0 12px rgba(234,179,8,0.7); }
.status-dot.down  { background: var(--down);  box-shadow: 0 0 12px rgba(239,68,68,0.7); animation: pulse 1.4s ease-in-out infinite; }
.status-dot.maint { background: var(--maint); box-shadow: 0 0 12px rgba(59,130,246,0.7); }

.overall.is-ok    { border-left: 4px solid var(--ok); }
.overall.is-warn  { border-left: 4px solid var(--warn); }
.overall.is-down  { border-left: 4px solid var(--down); }
.overall.is-maint { border-left: 4px solid var(--maint); }

.updated {
  font-size: 0.75rem;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
}

.overall-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.625rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--c-border);
}
.overall-stat {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 0.625rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.overall-stat .v {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-orange);
  line-height: 1.1;
}
.overall-stat .l {
  font-size: 0.65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ═══ Seções ═══════════════════════════════════════════════════ */
section.block { margin: 1.5rem 0; }
section.block > h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-muted);
  margin: 0 0 0.75rem;
  padding: 0 0.25rem;
}

/* ═══ Incidentes ativos ════════════════════════════════════════ */
.active-incident {
  background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.04));
  border: 1px solid rgba(239,68,68,0.5);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 30px rgba(239,68,68,0.08);
}
.active-incident h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--c-white);
}
.active-incident .meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  color: var(--c-muted);
}
.active-incident .last-update {
  font-size: 0.9rem;
  color: #f2d0d0;
  margin: 0.5rem 0 0.75rem;
  line-height: 1.55;
}

.maintenance {
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(59,130,246,0.04));
  border: 1px solid rgba(59,130,246,0.5);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 30px rgba(59,130,246,0.06);
}
.maintenance h3 { margin: 0 0 0.4rem; font-size: 1.05rem; color: var(--c-white); }
.maintenance .window {
  font-size: 0.825rem;
  color: #c9dcfb;
  margin-bottom: 0.5rem;
}

.affected { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.625rem; }
.affected-badge {
  font-size: 0.7rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--c-border);
  color: #eaeaea;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

/* ═══ Badges de status ═════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.badge::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.badge.ok      { color: var(--ok);      background: rgba(34,197,94,0.1);  border-color: rgba(34,197,94,0.3); }
.badge.warn    { color: var(--warn);    background: rgba(234,179,8,0.1);  border-color: rgba(234,179,8,0.3); }
.badge.partial { color: var(--partial); background: rgba(232,119,34,0.1); border-color: rgba(232,119,34,0.3); }
.badge.down    { color: var(--down);    background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3); }
.badge.maint   { color: var(--maint);   background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); }
.badge.unknown { color: var(--c-muted); background: rgba(255,255,255,0.04); border-color: var(--c-border); }
.badge.invest  { color: #fca5a5;        background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); }
.badge.ident   { color: #fde68a;        background: rgba(234,179,8,0.15); border-color: rgba(234,179,8,0.4); }
.badge.monitor { color: #bfdbfe;        background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.4); }

/* ═══ Grupos (accordion <details>) ═════════════════════════════ */
.group {
  background: var(--g-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  margin-bottom: 0.875rem;
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.group[open],
.group:hover {
  border-color: var(--c-border-2);
}

.group-summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  user-select: none;
  position: relative;
  transition: background var(--t-fast);
}
.group-summary::-webkit-details-marker { display: none; }
.group-summary:hover { background: rgba(255,255,255,0.015); }

.chevron {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-muted);
  flex-shrink: 0;
  transition: transform var(--t-normal), color var(--t-fast), border-color var(--t-fast);
}
.group[open] .chevron {
  transform: rotate(90deg);
  color: var(--c-orange);
  border-color: rgba(242,138,70,0.3);
}
.chevron svg { width: 14px; height: 14px; display: block; }

.group-meta {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}
.group-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--c-white);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-extras {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}
.group-count {
  font-size: 0.72rem;
  color: var(--c-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-variant-numeric: tabular-nums;
}

.group-body {
  border-top: 1px solid var(--c-border);
  padding: 0.25rem 0 0.5rem;
  animation: slideDown var(--t-normal);
}

.component {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: center;
}
.component:last-child { border-bottom: none; }

.component-name {
  font-size: 0.9rem;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.component-name::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34,197,94,0.55);
}
.component-name[data-st="warn"]::before    { background: var(--warn);    box-shadow: 0 0 6px rgba(234,179,8,0.55); }
.component-name[data-st="partial"]::before { background: var(--partial); box-shadow: 0 0 6px rgba(232,119,34,0.55); }
.component-name[data-st="down"]::before    { background: var(--down);    box-shadow: 0 0 6px rgba(239,68,68,0.55); }
.component-name[data-st="maint"]::before   { background: var(--maint);   box-shadow: 0 0 6px rgba(59,130,246,0.55); }

.component-status { justify-self: end; }

.history-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.history {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: flex-start;
}
.history-cell {
  width: 3px;
  height: 28px;
  border-radius: 2px;
  background: rgba(34,197,94,0.8);
  flex-shrink: 0;
  transition: transform 0.12s ease;
}
.history-cell:hover { transform: scaleY(1.15); }
.history-cell.ok      { background: rgba(34,197,94,0.85); }
.history-cell.warn    { background: var(--warn); }
.history-cell.partial { background: var(--partial); }
.history-cell.down    { background: var(--down); }
.history-cell.maint   { background: var(--maint); }
.uptime-pct {
  font-size: 0.74rem;
  color: var(--c-muted);
  font-variant-numeric: tabular-nums;
  min-width: 62px;
  text-align: right;
  font-weight: 600;
}

/* ═══ Histórico de incidentes resolvidos ══════════════════════ */
.history-day {
  padding: 1rem 0 0.5rem;
  border-top: 1px solid var(--c-border);
}
.history-day:first-child { border-top: none; padding-top: 0.25rem; }
.history-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.5rem;
}
.history-incident {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  transition: border-color var(--t-fast);
}
.history-incident:hover { border-color: var(--c-border-2); }
.history-incident .name { font-weight: 600; color: var(--c-text); margin-bottom: 0.2rem; }
.history-incident .duration {
  font-size: 0.72rem;
  color: var(--c-muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.history-incident .duration .sep { color: var(--c-muted2); }

.empty {
  color: var(--c-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem;
  background: var(--g-card);
  border: 1px dashed var(--c-border);
  border-radius: var(--r-md);
}

/* ═══ Assinatura por e-mail ═══════════════════════════════════ */
.subscribe-card {
  background: var(--g-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1.75rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.subscribe-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(242,138,70,0.18), transparent 70%);
  pointer-events: none;
}
.subscribe-head {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.subscribe-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(242,138,70,0.1);
  border: 1px solid rgba(242,138,70,0.25);
  color: var(--c-orange);
}
.subscribe-head h3 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.01em;
}
.subscribe-head p {
  margin: 0;
  color: var(--c-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.subscribe-form {
  display: flex;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
.subscribe-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.subscribe-input-wrap svg {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-muted);
  pointer-events: none;
}
.subscribe-form input[type="email"] {
  width: 100%;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.75rem 0.9rem 0.75rem 2.35rem;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.subscribe-form input[type="email"]::placeholder { color: var(--c-muted2); }
.subscribe-form input[type="email"]:focus {
  outline: none;
  border-color: rgba(242,138,70,0.55);
  background: var(--c-surface);
  box-shadow: 0 0 0 3px rgba(242,138,70,0.12);
}

.subscribe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--g-orange);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  box-shadow: 0 4px 16px rgba(242,138,70,0.25);
  white-space: nowrap;
}
.subscribe-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(242,138,70,0.35); }
.subscribe-btn:active { transform: translateY(0); }
.subscribe-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.subscribe-btn .spinner { display: none; animation: spin 0.9s linear infinite; }
.subscribe-btn.is-loading .lbl { opacity: 0.7; }
.subscribe-btn.is-loading .spinner { display: inline-block; }

.subscribe-msg {
  margin-top: 0.75rem;
  font-size: 0.825rem;
  min-height: 1.1rem;
  position: relative;
  z-index: 1;
}
.subscribe-msg.is-error   { color: #fca5a5; }
.subscribe-msg.is-success { color: #86efac; }

.subscribe-foot {
  margin: 1rem 0 0;
  font-size: 0.72rem;
  color: var(--c-muted2);
  position: relative;
  z-index: 1;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ Footer ═══════════════════════════════════════════════════ */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--c-muted); }
.site-footer a:hover { color: var(--c-orange); }
.site-footer .sep { color: var(--c-muted2); margin: 0 0.3rem; }

/* ═══ Skeleton / Erro ══════════════════════════════════════════ */
.skeleton {
  background: var(--g-card);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 0.875rem;
  min-height: 60px;
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton.lg { min-height: 120px; }
.error-box {
  background: rgba(239,68,68,0.08);
  border: 1px solid var(--down);
  color: #fca5a5;
  padding: 1rem 1.25rem;
  border-radius: var(--r-md);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.error-box strong { color: #fecaca; }

/* ═══ Animações ════════════════════════════════════════════════ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ═══ Responsivo ═══════════════════════════════════════════════ */
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .container { padding: 0 1rem; }
  .page-head { padding: 2rem 0 0.5rem; }
  .logo-sub { display: none; }
  .overall-stats { grid-template-columns: repeat(2, 1fr); }
  .overall { padding: 1.25rem; }
  .group-summary { padding: 0.875rem 1rem; }
  .component { padding: 0.75rem 1rem; }
  .history-cell { width: 4px; height: 26px; }
  .history { gap: 1px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .group-count { display: none; }
  .subscribe-card { padding: 1.25rem; }
  .subscribe-form { flex-direction: column; }
  .subscribe-btn { width: 100%; padding: 0.85rem 1rem; }
}
