/* ============================================
   COMPONENTES — pagespeed.com.br (design system .ps-*)
============================================ */

.ps-container { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; }

/* ── HEADER ───────────────────────────────── */
.ps-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-height);
  background: var(--ps-surface);
  border-bottom: 1px solid var(--ps-border);
}
.ps-header__inner {
  height: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 32px;
}
.ps-logo { display: flex; align-items: center; gap: 10px; }
.ps-logo__mark { display: flex; flex-direction: column; gap: 3px; }
.ps-logo__bar { height: 4px; border-radius: 2px; animation: none; }
.ps-logo__bar:nth-child(1) { width: 28px; background: var(--ps-blue); }
.ps-logo__bar:nth-child(2) { width: 22px; background: var(--ps-critico); }
.ps-logo__bar:nth-child(3) { width: 18px; background: var(--ps-regular); }
.ps-logo__bar:nth-child(4) { width: 14px; background: var(--ps-excelente); }
.ps-logo__text { font-size: 18px; font-weight: 800; color: var(--ps-charcoal); letter-spacing: -0.02em; }
.ps-logo__text span { color: var(--ps-blue); }
.ps-nav { display: flex; align-items: center; gap: 4px; }
.ps-nav__link {
  padding: 6px 12px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500; color: var(--ps-muted);
  transition: color .15s, background .15s;
}
.ps-nav__link:hover { color: var(--ps-charcoal); background: var(--ps-bg); }
.ps-nav__link.active { color: var(--ps-blue); background: var(--ps-blue-light); }
.ps-header__actions { display: flex; align-items: center; gap: 8px; }

/* ── BOTÕES ───────────────────────────────── */
.ps-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 600; font-family: var(--font-sans);
  cursor: pointer; border: none; transition: background .15s, transform .1s;
  white-space: nowrap;
}
.ps-btn:active { transform: scale(0.98); }
.ps-btn--primary { background: var(--ps-blue); color: var(--ps-bg-white); }
.ps-btn--primary:hover { background: var(--ps-blue-dark); }
.ps-btn--secondary { background: var(--ps-charcoal); color: var(--ps-bg-white); }
.ps-btn--secondary:hover { background: var(--ps-charcoal-soft); }
.ps-btn--ghost {
  background: transparent; color: var(--ps-muted);
  border: 1.5px solid var(--ps-border);
}
.ps-btn--ghost:hover { background: var(--ps-bg); color: var(--ps-charcoal); }
.ps-btn--lg { padding: 13px 28px; font-size: 15px; }
.ps-btn--sm { padding: 6px 12px; font-size: 12px; }
.ps-btn--block { width: 100%; justify-content: center; }

/* ── HERO ─────────────────────────────────── */
.ps-hero {
  background: var(--ps-surface);
  padding: 80px 0 72px;
  border-bottom: 1px solid var(--ps-border);
}
.ps-hero__inner { text-align: center; max-width: 720px; margin: 0 auto; }
.ps-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ps-blue-light); color: var(--ps-blue);
  font-size: 12px; font-weight: 600; padding: 4px 12px;
  border-radius: 20px; margin-bottom: 20px;
  border: 1px solid var(--ps-bom-border);
}
.ps-hero__title {
  font-size: 42px; font-weight: 800; line-height: 1.18;
  letter-spacing: -0.03em; color: var(--ps-charcoal);
  margin-bottom: 16px;
}
.ps-hero__title span { color: var(--ps-blue); }
.ps-hero__subtitle {
  font-size: 17px; color: var(--ps-muted); margin-bottom: 36px;
  line-height: 1.6;
}

/* ── FORMULÁRIO DE ANÁLISE ────────────────── */
.ps-analyzer {
  background: var(--ps-bg);
  border: 1.5px solid var(--ps-border);
  border-radius: var(--radius-lg);
  padding: 24px; max-width: 640px; margin: 0 auto 20px;
}
.ps-analyzer__label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--ps-muted); margin-bottom: 8px;
}
.ps-input-group { display: flex; gap: 8px; }
.ps-input {
  flex: 1; padding: 11px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--ps-border); font-size: 14px;
  font-family: var(--font-sans); color: var(--ps-text);
  background: var(--ps-surface); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ps-input:focus {
  border-color: var(--ps-blue);
  box-shadow: 0 0 0 3px rgba(26,101,224,.12);
}
.ps-input::placeholder { color: var(--ps-subtle); }
.ps-analyzer__hint {
  font-size: 12px; color: var(--ps-subtle); margin-top: 10px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ps-chip {
  background: var(--ps-surface); border: 1px solid var(--ps-border);
  border-radius: 20px; padding: 2px 8px; font-size: 11px;
  font-family: var(--font-mono); color: var(--ps-muted);
  cursor: pointer; transition: border-color .15s;
}
.ps-chip:hover { border-color: var(--ps-blue); color: var(--ps-blue); }
.ps-hero__proof {
  font-size: 12px; color: var(--ps-subtle);
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.ps-hero__proof span { display: flex; align-items: center; gap: 4px; }
.ps-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ps-excelente); }

/* ── SEÇÃO ─────────────────────────────────── */
.ps-section { padding: 64px 0; }
.ps-section--alt { background: var(--ps-surface); }
.ps-section__header { text-align: center; max-width: 560px; margin: 0 auto 48px; }
.ps-section__eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ps-blue); margin-bottom: 10px;
}
.ps-section__title {
  font-size: 30px; font-weight: 700; color: var(--ps-charcoal);
  letter-spacing: -0.02em; margin-bottom: 12px; line-height: 1.25;
}
.ps-section__desc { font-size: 15px; color: var(--ps-muted); line-height: 1.65; }

/* ── CARDS ─────────────────────────────────── */
.ps-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.ps-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.ps-card {
  background: var(--ps-surface); border: 1px solid var(--ps-border);
  border-radius: var(--radius-lg); padding: 24px;
}
.ps-card--hover { transition: transform .2s, border-color .2s, box-shadow .2s; cursor: pointer; }
.ps-card--hover:hover {
  transform: translateY(-2px);
  border-color: var(--ps-blue);
  box-shadow: 0 4px 16px rgba(26,101,224,.1);
}
.ps-card__icon {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--ps-blue-light); display: flex; align-items: center;
  justify-content: center; margin-bottom: 14px; font-size: 18px;
}
.ps-card__title { font-size: 15px; font-weight: 600; color: var(--ps-charcoal); margin-bottom: 6px; }
.ps-card__desc { font-size: 13px; color: var(--ps-muted); line-height: 1.6; }
.ps-card--metric { text-align: center; }
.ps-card__metric-value {
  font-size: 36px; font-weight: 800; color: var(--ps-charcoal);
  letter-spacing: -0.03em; line-height: 1;
}
.ps-card__metric-value.blue { color: var(--ps-blue); }
.ps-card__metric-label {
  font-size: 12px; font-weight: 500; color: var(--ps-muted);
  text-transform: uppercase; letter-spacing: .06em; margin-top: 6px;
}

/* ── SCORE GAUGE ──────────────────────────── */
.ps-score-preview {
  display: flex; align-items: center; justify-content: center;
  gap: 40px; padding: 40px; background: var(--ps-surface);
  border: 1px solid var(--ps-border); border-radius: var(--radius-lg);
}
.ps-gauge { text-align: center; }
.ps-gauge svg { display: block; margin: 0 auto 8px; }
.ps-gauge__label { font-size: 12px; color: var(--ps-muted); font-weight: 500; }
.ps-gauge__value { font-size: 22px; font-weight: 800; color: var(--ps-charcoal); }

/* ── BADGES ───────────────────────────────── */
.ps-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.ps-badge--excelente { background: var(--ps-excelente-bg); color: var(--ps-excelente-text); }
.ps-badge--bom       { background: var(--ps-bom-bg);       color: var(--ps-bom-text); }
.ps-badge--regular   { background: var(--ps-regular-bg);   color: var(--ps-regular-text); }
.ps-badge--critico   { background: var(--ps-critico-bg);   color: var(--ps-critico-text); }

/* ── TABELA ───────────────────────────────── */
.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ps-table th {
  background: var(--ps-charcoal); color: var(--ps-bg-white);
  padding: 10px 14px; text-align: left;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em;
}
.ps-table th:first-child { border-radius: 8px 0 0 0; }
.ps-table th:last-child  { border-radius: 0 8px 0 0; }
.ps-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--ps-border);
  color: var(--ps-text);
}
.ps-table tr:nth-child(even) td { background: var(--ps-surface-2); }
.ps-table tr:hover td { background: var(--ps-blue-light); }

/* ── ALERT ────────────────────────────────── */
.ps-alert {
  display: flex; gap: 10px; padding: 12px 14px;
  border-radius: var(--radius-md); font-size: 13px; line-height: 1.55;
  border-left: 3px solid;
}
.ps-alert--info    { background: var(--ps-bom-bg);       color: var(--ps-bom-text); border-color: var(--ps-blue); }
.ps-alert--success { background: var(--ps-excelente-bg); color: var(--ps-excelente-text); border-color: var(--ps-excelente); }
.ps-alert--warning { background: var(--ps-regular-bg);   color: var(--ps-regular-text); border-color: var(--ps-regular); }
.ps-alert--error   { background: var(--ps-critico-bg);   color: var(--ps-critico-text); border-color: var(--ps-critico); }

/* ── CTA STRIP ────────────────────────────── */
.ps-cta-strip {
  background: var(--ps-charcoal); color: var(--ps-bg-white);
  padding: 64px 0; text-align: center;
}
.ps-cta-strip__title {
  font-size: 30px; font-weight: 700; margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.ps-cta-strip__desc { font-size: 16px; color: rgba(255,255,255,.65); margin-bottom: 28px; }

/* ── FOOTER ───────────────────────────────── */
.ps-footer {
  background: var(--ps-surface); border-top: 1px solid var(--ps-border);
  padding: 32px 0;
}
.ps-footer__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px;
}
.ps-footer__copy { font-size: 13px; color: var(--ps-subtle); }
.ps-footer__links { display: flex; gap: 16px; }
.ps-footer__links a { font-size: 13px; color: var(--ps-muted); }
.ps-footer__links a:hover { color: var(--ps-blue); }

/* ── DIVISOR / FORM ───────────────────────── */
.ps-divider { height: 1px; background: var(--ps-border); margin: 0; }
.ps-label { display: block; font-size: 13px; font-weight: 500; color: var(--ps-text); margin-bottom: 5px; }
.ps-error { font-size: 12px; color: var(--ps-critico); margin-top: 4px; }
.ps-select {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--ps-border); font-size: 14px;
  font-family: var(--font-sans); color: var(--ps-text);
  background: var(--ps-surface); outline: none; cursor: pointer;
}
.ps-select:focus { border-color: var(--ps-blue); box-shadow: 0 0 0 3px rgba(26,101,224,.12); }

/* ════════════════════════════════════════════
   AUTENTICAÇÃO — Módulo 02 (login, cadastro, senha)
   Reaproveita .ps-input/.ps-label/.ps-btn/.ps-alert
════════════════════════════════════════════ */
.ps-auth {
  min-height: calc(100vh - var(--header-height));
  display: flex; align-items: center; justify-content: center;
  padding: 48px 16px;
}
.ps-auth__card {
  width: 100%; max-width: 440px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.ps-auth__card--wide { max-width: 560px; }
.ps-auth__head { text-align: center; margin-bottom: 24px; }
.ps-auth__title {
  font-size: 24px; font-weight: 800; color: var(--ps-charcoal);
  letter-spacing: -0.02em; margin-bottom: 6px;
}
.ps-auth__subtitle { font-size: 14px; color: var(--ps-muted); }
.ps-form-group { margin-bottom: 16px; }
.ps-form-group .ps-input { width: 100%; flex: initial; }
.ps-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ps-checkbox {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--ps-muted); line-height: 1.5;
  margin-bottom: 16px; cursor: pointer;
}
.ps-checkbox input { margin-top: 3px; accent-color: var(--ps-blue); }
.ps-auth__foot {
  text-align: center; font-size: 13px; color: var(--ps-muted);
  margin-top: 20px;
}
.ps-auth__foot a { font-weight: 600; }
.ps-auth__aux {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-top: -4px; margin-bottom: 16px;
}
.ps-alert-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 768px) {
  .ps-container { padding: 0 16px; }
  .ps-nav { display: none; }
  .ps-hero { padding: 48px 0; }
  .ps-hero__title { font-size: 28px; }
  .ps-input-group { flex-direction: column; }
  .ps-grid-3 { grid-template-columns: 1fr; }
  .ps-grid-4 { grid-template-columns: 1fr 1fr; }
  .ps-score-preview { flex-direction: column; gap: 24px; }
  .ps-footer__inner { flex-direction: column; text-align: center; }
  .ps-form-row { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   ANÁLISE PÚBLICA — Módulo 01 (formulário + relatório)
════════════════════════════════════════════ */
.ps-container--narrow { max-width: 920px; }
.ps-result .ps-card { margin-top: 20px; }
.ps-result .ps-alert { margin-top: 16px; }
.ps-result__url { color: var(--ps-muted); word-break: break-all; font-size: 14px; }
.ps-summary { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.ps-summary__title { font-size: 18px; font-weight: 600; color: var(--ps-charcoal); margin: 12px 0 4px; }
.ps-card__heading { font-size: 18px; font-weight: 600; color: var(--ps-charcoal); margin-bottom: 18px; }
.ps-card__heading--tight { margin-bottom: 6px; }

/* ── Score gauge (SVG animado via CSS) ── */
.ps-gauge__chart { position: relative; display: inline-block; }
.ps-gauge--g .ps-gauge__chart { width: 160px; }
.ps-gauge--m .ps-gauge__chart { width: 104px; }
.ps-gauge__svg { width: 100%; height: auto; display: block; transform: rotate(-90deg); }
.ps-gauge__track { fill: none; stroke: var(--ps-border); stroke-width: 10; }
.ps-gauge__ring {
  fill: none; stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: var(--circ); stroke-dashoffset: var(--circ);
  animation: ps-gauge-fill 1.1s ease-out forwards;
}
@keyframes ps-gauge-fill { to { stroke-dashoffset: var(--offset); } }
.ps-gauge__num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--ps-charcoal);
}
.ps-gauge--g .ps-gauge__num { font-size: 34px; }
.ps-gauge--m .ps-gauge__num { font-size: 22px; }
.ps-gauge--excelente .ps-gauge__ring { stroke: var(--ps-excelente); }
.ps-gauge--bom       .ps-gauge__ring { stroke: var(--ps-blue); }
.ps-gauge--regular   .ps-gauge__ring { stroke: var(--ps-regular); }
.ps-gauge--critico   .ps-gauge__ring { stroke: var(--ps-critico); }
.ps-gauge-grid { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }

/* ── Core Web Vitals ── */
.ps-cwv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.ps-cwv-item { border: 1px solid var(--ps-border); border-radius: var(--radius-md); padding: 14px; }
.ps-cwv-item__label { font-size: 12px; color: var(--ps-muted); }
.ps-cwv-item__value { font-size: 22px; font-weight: 700; margin: 4px 0; color: var(--ps-charcoal); }
.ps-badge--cwv-bom       { background: var(--ps-excelente-bg); color: var(--ps-excelente-text); }
.ps-badge--cwv-melhorar  { background: var(--ps-regular-bg);   color: var(--ps-regular-text); }
.ps-badge--cwv-ruim      { background: var(--ps-critico-bg);   color: var(--ps-critico-text); }
.ps-badge--cwv-sem-dados { background: var(--ps-bg);           color: var(--ps-subtle); }

/* ── Benchmark (diferença) ── */
.ps-diff--up   { color: var(--ps-excelente-text); font-weight: 600; }
.ps-diff--down { color: var(--ps-critico-text); font-weight: 600; }

/* ── Lista de problemas ── */
.ps-problema { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--ps-border); }
.ps-problema:last-child { border-bottom: 0; }
.ps-problema__num {
  flex: 0 0 28px; height: 28px; border-radius: 50%;
  background: var(--ps-critico-bg); color: var(--ps-critico); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ps-problema__desc { font-size: 13px; color: var(--ps-muted); margin-top: 2px; }

/* ── CTA pós-relatório ── */
.ps-cta-box {
  margin-top: 24px; text-align: center; background: var(--ps-blue); color: var(--ps-bg-white);
  padding: 28px; border-radius: var(--radius-lg);
}
.ps-cta-box__title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.ps-cta-box .ps-btn { margin-top: 14px; background: var(--ps-bg-white); color: var(--ps-blue); }

/* ── Overlay de carregamento ── */
.ps-overlay {
  position: fixed; inset: 0; z-index: 200; gap: 14px;
  background: rgba(245, 247, 250, .92);
  display: none; align-items: center; justify-content: center; flex-direction: column;
}
.ps-overlay.is-active { display: flex; }
.ps-spinner {
  width: 56px; height: 56px; border: 6px solid var(--ps-border);
  border-top-color: var(--ps-blue); border-radius: 50%;
  animation: ps-spin 1s linear infinite;
}
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════════
   TEMA CLARO — SITE PÚBLICO (clareamento harmonioso)
   As regras-base acima já produzem o visual claro via tokens; aqui apenas
   reforçamos fundos/sombra/CTA e mantemos os títulos em Sora.
════════════════════════════════════════════ */

/* Logo em PNG */
.ps-logo__img { display: block; height: 34px; width: auto; }

/* Sufixo "(opcional)" em labels */
.ps-label__opt { color: var(--ps-subtle); font-weight: 400; }

/* Header branco com sombra sutil */
.ps-header { background: var(--ps-bg-white); border-bottom: 0; box-shadow: var(--ps-shadow-sm); }

/* Hero branco com borda inferior sutil */
.ps-hero { background: var(--ps-bg-white); }

/* Seções alternadas em off-white */
.ps-section--alt { background: var(--ps-bg-subtle); }

/* CTA strip em azul da marca (texto branco) + botão branco */
.ps-cta-strip { background: var(--ps-blue); }
.ps-cta-strip .ps-btn { background: var(--ps-bg-white); color: var(--ps-blue); }
.ps-cta-strip .ps-btn:hover { background: var(--ps-bg-subtle); }

/* Footer off-white com borda superior */
.ps-footer { background: var(--ps-bg-subtle); border-top: 1px solid var(--ps-border); }

/* Títulos do site em Sora (display) */
.ps-hero__title,
.ps-section__title,
.ps-auth__title { font-family: var(--font-display); }

/* === Modificadores compartilhados (pílula + radio + full) — Módulos 06/07 === */
.ps-btn--pill   { border-radius: var(--radius-pill); }
.ps-btn--full   { width: 100%; justify-content: center; }
.ps-badge--pill { border-radius: var(--radius-pill); }
.ps-radio {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); color: var(--ps-text); cursor: pointer;
}
.ps-radio input { accent-color: var(--ps-blue); }

/* === Acessibilidade: foco visível em TODOS os elementos interativos === */
a:focus-visible,
button:focus-visible,
.ps-btn:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 101, 224, .25);
  border-radius: var(--radius-md);
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
