/* ==========================================================================
   HORA.RBTO20.COM — DESIGN SYSTEM MASTER STYLESHEET
   Diretrizes oficiais: AI_AGENT_GUIDELINES.md
   Estética: Minimalismo Técnico, Dark Clean (#0b0e14), Teal Cirúrgico (#009688)
   Regra Absoluta: 100% Livre de Emojis em todo o código e interface.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DEFINIÇÃO TIPOGRÁFICA (JetBrains Mono Local + Fallback Web)
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/JetBrainsMono-VariableFont_wght.ttf') format('truetype-variations'),
       url('assets/JetBrainsMono-VariableFont_wght.ttf') format('truetype');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

/* --------------------------------------------------------------------------
   2. DESIGN TOKENS & VARIÁVEIS OFICIAIS (:root)
   -------------------------------------------------------------------------- */
:root {
  /* Fundo & Superfícies */
  --bg-color: #0b0e14;                    /* Fundo global escuro profundo (nunca preto puro #000) */
  --card-bg: rgba(255, 255, 255, 0.015);  /* Fundo sutil de cartões e itens */
  --card-bg-hover: rgba(255, 255, 255, 0.03); /* Hover em superfícies neutras */

  /* Caixas de Entrada & Código */
  --code-bg: #080a0f;                     /* Fundo escuro de inputs, textareas e blocos <pre> */
  --code-header-bg: #0f131a;              /* Cabeçalho de caixas de código ou cartões */

  /* Destaque (Accent) — Teal Cirúrgico */
  --ds-teal-500: #009688;                 /* Teal primário oficial (links, botão accent, foco) */
  --ds-teal-400: #26a69a;                 /* Teal secundário / foco acessível */
  --ds-teal-subtle: rgba(0, 150, 136, 0.1);   /* Fundo suave em hover de botões/cartões */
  --ds-teal-border: rgba(0, 150, 136, 0.35);  /* Contorno destacado ativo */

  /* Textos & Contrastes */
  --text-primary: #ededed;               /* Texto primário de alto contraste (títulos, valores) */
  --text-secondary: #9aa4b2;             /* Texto de leitura, labels de formulários, descrições */
  --text-muted: #555e6d;                 /* Metadados, timestamps, rodapé, links de canto */

  /* Bordas & Divisores */
  --border-color: #21262d;               /* Borda universal de caixas, inputs e divisores */
  --border-hover: #30363d;               /* Borda durante estados interativos neutros */

  /* Status Tokens */
  --status-up: #009688;                   /* Operacional / Sucesso */
  --status-up-subtle: rgba(0, 150, 136, 0.12);
  --status-up-border: rgba(0, 150, 136, 0.35);

  --status-degraded: #d29922;             /* Instável / Alerta */
  --status-degraded-subtle: rgba(210, 153, 34, 0.12);
  --status-degraded-border: rgba(210, 153, 34, 0.35);

  --status-down: #f85149;                 /* Erro / Falha / Fora do Ar */
  --status-down-subtle: rgba(248, 81, 73, 0.12);
  --status-down-border: rgba(248, 81, 73, 0.35);

  --status-empty: #161b22;                /* Ausência de dados / Não monitorado */

  /* Tipografia Monospaçada */
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* --------------------------------------------------------------------------
   3. RESET UNIVERSAL & ESTILOS BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 15px;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  line-height: 1.6;
  scroll-behavior: smooth;
  min-height: 100%;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: var(--ds-teal-500);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   4. ESTRUTURAS DE LAYOUT
   -------------------------------------------------------------------------- */
.site-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.25rem, 5vw, 2.5rem);
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  position: relative;
}

/* Wrapper Específico do Relógio */
.clock-site-wrapper {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

/* Largura da Subpágina Institucional (480px) */
.subpage-frame,
.privacy-page-frame {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: auto 0;
}

/* --------------------------------------------------------------------------
   5. CABEÇALHO PADRÃO DE APLICAÇÃO & RETORNO
   -------------------------------------------------------------------------- */
.privacy-header,
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  cursor: default;
  z-index: 10;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-brand-link {
  text-decoration: none;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  transition: color 0.15s ease;
  cursor: pointer;
}

.header-brand-link:hover .header-name {
  color: var(--ds-teal-500);
}

.header-name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.publ-nav-actions,
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botão Início / Voltar: Texto padrão em branco com transição para Teal no hover */
.btn-exit {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.btn-exit:hover,
.btn-exit:focus-visible {
  border-color: var(--ds-teal-500);
  color: var(--ds-teal-500);
  background: var(--ds-teal-subtle);
  outline: none;
}

.btn-exit-icon {
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   6. MOSTRADOR CENTRAL DO RELÓGIO (ALTA PRECISÃO)
   -------------------------------------------------------------------------- */
.clock-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1000px;
  padding: 1.5rem 0;
  box-sizing: border-box;
}

.clock-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  gap: 1.75rem;
}

/* Mostrador dos Dígitos */
.clock-display {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "zero" 1;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  font-size: clamp(2.4rem, 11vw, 7.8rem);
  transition: font-size 0.2s ease, transform 0.15s ease;
  outline: none;
}

.clock-display:focus-visible {
  outline: 1px solid var(--ds-teal-border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
}

/* Quando os segundos estão ocultos, os dígitos principais expandem harmoniosamente */
.clock-display.hide-seconds {
  font-size: clamp(3.6rem, 16vw, 11.5rem);
}

.clock-unit {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.clock-colon {
  color: var(--ds-teal-500);
  margin: 0 0.04em;
  font-weight: 400;
  opacity: 0.95;
  display: inline-block;
  user-select: none;
}

.clock-seconds-group {
  display: inline-flex;
  align-items: baseline;
  transition: opacity 0.15s ease;
}

.clock-display.hide-seconds .clock-seconds-group {
  display: none;
}

/* --------------------------------------------------------------------------
   7. PAINEL DE DATA & METADADOS
   -------------------------------------------------------------------------- */
.clock-info-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  max-width: 600px;
}

.clock-date {
  font-size: clamp(0.85rem, 2.2vw, 1.15rem);
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.clock-meta {
  font-size: clamp(0.72rem, 1.6vw, 0.82rem);
  color: var(--text-secondary);
  font-weight: 400;
}

.clock-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  letter-spacing: 0.01em;
  transition: color 0.15s ease, opacity 0.15s ease;
  opacity: 0.75;
}

.clock-site-wrapper:hover .clock-hint {
  color: var(--text-secondary);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   8. PÁGINAS DE TEXTO / PRIVACIDADE
   -------------------------------------------------------------------------- */
.privacy-body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.privacy-body p {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.privacy-body strong {
  color: var(--text-primary);
  font-weight: 500;
}

.privacy-links-group {
  margin-top: 0.5rem;
}

.text-link {
  color: var(--ds-teal-500);
  text-decoration: underline;
  text-decoration-color: var(--border-color);
  text-underline-offset: 3px;
  font-size: 0.85rem;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.text-link:hover {
  color: #ffffff;
  text-decoration-color: var(--ds-teal-500);
}

/* --------------------------------------------------------------------------
   9. O RODAPÉ FIXO (.corner-privacy)
   -------------------------------------------------------------------------- */
.corner-privacy {
  position: fixed;
  bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
  right: max(1.75rem, env(safe-area-inset-right, 1.75rem));
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.72rem;
  z-index: 50;
  background: rgba(11, 14, 20, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: default;
}

.privacy-link {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border-color);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
  cursor: pointer;
}

.privacy-link:hover {
  color: var(--ds-teal-500);
  text-decoration-color: var(--ds-teal-500);
}

/* --------------------------------------------------------------------------
   10. TOAST DE FEEDBACK FLUTUANTE
   -------------------------------------------------------------------------- */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0d1117;
  border: 1px solid var(--ds-teal-500);
  color: var(--text-primary);
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.toast-notice.is-active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------------------------------
   11. MODO TELA CHEIA (FULLSCREEN)
   -------------------------------------------------------------------------- */
:fullscreen .app-header,
:-webkit-full-screen .app-header {
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

:fullscreen .app-header:hover,
:-webkit-full-screen .app-header:hover {
  opacity: 1;
}

:fullscreen .corner-privacy,
:-webkit-full-screen .corner-privacy {
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

:fullscreen .corner-privacy:hover,
:-webkit-full-screen .corner-privacy:hover {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   12. AJUSTES RESPONSIVOS MOBILE
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .site-wrapper {
    padding: 1rem 1rem 3.5rem 1rem;
  }

  .clock-main {
    padding: 1rem 0;
  }

  .clock-section {
    gap: 1.25rem;
  }

  .corner-privacy {
    bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    right: max(1rem, env(safe-area-inset-right, 1rem));
  }
}
