/* ---------- Tokens ---------- */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --petrol-900: #06222a;
  --petrol-800: #0d3b45;
  --petrol-700: #12505d;

  --bg: #ffffff;
  --surface: #f4f7f8;
  --card: #ffffff;
  --text: #10242a;
  --muted: #566a71;
  --line: #dde5e8;
  --line-soft: #e9eef0;

  --accent: #0f8fa8;
  --accent-dark: #0a6d81;
  --accent-soft: #e2f2f5;

  --gold: #c47f0a;
  --gold-soft: #fbf0dc;

  --good: #1a7f4b;
  --good-soft: #e3f2ea;
  --warn: #9a6708;
  --stop: #a83a2c;

  --shadow: 0 14px 40px rgba(6, 34, 42, .10);
  --lift: 0 22px 60px rgba(6, 34, 42, .26);
  --r-lg: 16px;
  --r-md: 11px;
  --r-sm: 8px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1a1f;
    --surface: #0f242a;
    --card: #132b32;
    --text: #e6eef0;
    --muted: #9ab0b7;
    --line: #22414a;
    --line-soft: #1a333a;
    --accent: #4fc3d9;
    --accent-dark: #7dd6e8;
    --accent-soft: #10333c;
    --gold: #e8ab48;
    --gold-soft: #2c2211;
    --good: #5fc38d;
    --good-soft: #12301f;
    --shadow: 0 14px 40px rgba(0, 0, 0, .42);
  }
}
:root[data-theme="dark"] {
  --bg: #0a1a1f;
  --surface: #0f242a;
  --card: #132b32;
  --text: #e6eef0;
  --muted: #9ab0b7;
  --line: #22414a;
  --line-soft: #1a333a;
  --accent: #4fc3d9;
  --accent-dark: #7dd6e8;
  --accent-soft: #10333c;
  --gold: #e8ab48;
  --gold-soft: #2c2211;
  --good: #5fc38d;
  --good-soft: #12301f;
  --shadow: 0 14px 40px rgba(0, 0, 0, .42);
}

html { scroll-behavior: smooth; }

/* O atributo hidden precisa vencer qualquer display definido em classe —
   sem isto, .empty-state { display: flex } mantém o bloco visível. */
[hidden] { display: none !important; }

body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: 760px; }

h1, h2, h3 { color: var(--text); line-height: 1.2; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(29px, 5vw, 46px); font-weight: 800; margin-bottom: 14px; }
h2 { font-size: clamp(22px, 3.2vw, 30px); font-weight: 700; margin-bottom: 16px; }
h3 { font-size: 18px; font-weight: 700; margin: 26px 0 10px; }
p { margin: 0 0 16px; }
a { color: var(--accent-dark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; background: var(--accent); color: #fff;
  padding: 12px 18px; border-radius: var(--r-sm); z-index: 100; font-weight: 700;
}
.skip-link:focus { left: 16px; top: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
  background: var(--petrol-900);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  max-width: 1060px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  font-weight: 800; font-size: 17px; text-decoration: none; color: #fff;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  color: #06222a; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800;
}
.primary-nav { display: flex; gap: 22px; }
.primary-nav a {
  text-decoration: none; color: #a7c0c7; font-size: 15px; font-weight: 600;
  transition: color .15s;
}
.primary-nav a:hover { color: #fff; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 44px; height: 44px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-sm);
  background: transparent; color: #cfe2e7; cursor: pointer;
  font-size: 18px; line-height: 1; transition: background .15s, border-color .15s;
}
.theme-toggle:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.34); }
.theme-toggle .icon-dark { display: none; }
.theme-toggle .icon-light { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-dark { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-dark { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-light { display: none; }
}

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0; position: relative;
  border: 1px solid rgba(255,255,255,.18); border-radius: var(--r-sm);
  background: transparent; cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 20px; height: 2px; background: #fff; content: "";
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { top: -6px; left: 0; }
.nav-toggle-bar::after { top: 6px; left: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  background:
    radial-gradient(1000px 420px at 50% -14%, var(--petrol-700) 0%, transparent 68%),
    linear-gradient(180deg, var(--petrol-800) 0%, var(--petrol-900) 100%);
  padding: 62px 0 118px;
}
.hero .container { position: relative; }
.hero h1 { color: #fff; }
.hero-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
  background: rgba(196,127,10,.14); border: 1px solid rgba(196,127,10,.32);
  padding: 6px 14px; border-radius: 999px; margin: 0 0 18px;
}
.hero-question {
  font-size: clamp(18px, 3vw, 26px); font-weight: 700;
  color: var(--accent); margin: 0 0 14px; letter-spacing: -.02em; line-height: 1.25;
}
.hero-sub {
  max-width: 640px; margin: 0 auto; color: #b6cdd3;
  font-size: clamp(15px, 2vw, 17.5px);
}

/* ---------- Calculator ---------- */
.calc-section { padding: 0 0 52px; margin-top: -78px; position: relative; z-index: 2; }
.calc-grid {
  display: grid; gap: 20px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.calc-card, .result-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--lift); padding: 24px;
}

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 12px 13px; font-size: 16px; font-family: inherit;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field-hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* time rows on the main calculator */
.time-rows { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.time-row { display: flex; gap: 8px; align-items: center; }
.time-row select.op {
  flex: 0 0 62px; padding: 12px 6px; font-size: 17px; font-weight: 700; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--text); font-family: inherit;
}
.time-row input.t {
  flex: 1 1 auto; min-width: 0; padding: 12px 13px; font-size: 16px; font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.time-row .rm {
  flex: 0 0 44px; height: 44px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); border-radius: var(--r-md);
  cursor: pointer; font-size: 19px; line-height: 1; font-family: inherit;
}
.time-row .rm:hover { color: var(--stop); border-color: var(--stop); }

.btn-add {
  width: 100%; padding: 12px; margin-bottom: 14px;
  background: var(--surface); color: var(--accent-dark);
  border: 1px dashed var(--line); border-radius: var(--r-md);
  font-family: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
}
.btn-add:hover { border-color: var(--accent); }

.btn-primary {
  width: 100%; padding: 15px 18px; font-size: 15px; font-weight: 800;
  letter-spacing: .03em; text-transform: uppercase; font-family: inherit;
  color: #06222a; background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  border: 0; border-radius: var(--r-md); cursor: pointer;
  transition: filter .12s, transform .12s;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }

.status { margin: 12px 0 0; font-size: 14px; font-weight: 700; color: var(--muted); }
.status-error { color: var(--stop); }

/* ---------- Results ---------- */
.result-card h2 { font-size: 19px; margin-bottom: 4px; }
.result-note { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }

.big-result {
  background: var(--accent-soft); border-radius: var(--r-md);
  padding: 22px; text-align: center; margin-bottom: 16px;
}
.big-value {
  font-size: clamp(34px, 7vw, 46px); font-weight: 800; line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text);
}
.big-label {
  font-size: 12px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted); margin-top: 8px;
}
.big-sub { font-size: 14.5px; color: var(--muted); margin-top: 6px; }

.money .big-value { color: var(--good); }

.rows { display: flex; flex-direction: column; gap: 1px; background: var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.rows .r {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  background: var(--card); padding: 12px 15px; font-size: 14.5px;
}
.rows .r .k { color: var(--muted); }
.rows .r .v { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows .r.total { background: var(--surface); }
.rows .r.total .k { color: var(--text); font-weight: 700; }
.rows .r.total .v { font-size: 17px; color: var(--good); }

.disclaimer {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}

/* Estado vazio: ocupa o espaço do resultado no desktop em vez de deixar
   metade da tela em branco, e diz o que vai acontecer. */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 46px 20px; min-height: 220px;
  border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface);
}
.empty-icon { font-size: 34px; line-height: 1; opacity: .5; margin-bottom: 12px; }
.empty-title { font-weight: 700; font-size: 16px; margin: 0 0 4px; color: var(--text); }
.empty-sub { font-size: 14px; color: var(--muted); margin: 0; max-width: 30ch; }

/* Cabeçalho das colunas do cartão de ponto */
.row-head {
  display: flex; gap: 8px; margin-bottom: 6px;
}
.row-head span {
  flex: 1 1 0; min-width: 0;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- Sections ---------- */
.section { padding: 50px 0; }
.section.alt { background: var(--surface); }
.section p { color: var(--muted); }
.section p strong, .section li strong { color: var(--text); }

.check-list { margin: 0 0 16px; padding-left: 20px; }
.check-list li { margin-bottom: 10px; color: var(--muted); }
.step-list { margin: 0 0 16px; padding-left: 22px; }
.step-list li { margin-bottom: 12px; color: var(--muted); }

.callout {
  background: var(--gold-soft); border-left: 3px solid var(--gold);
  padding: 16px 18px; border-radius: var(--r-sm); margin: 18px 0;
}
.callout p { color: var(--text); margin: 0; font-size: 15px; }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th {
  background: var(--surface); font-size: 12px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Tool grid ---------- */
.tool-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.tool-chip {
  display: block; text-decoration: none; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  color: var(--text); font-weight: 700; font-size: 15px;
  transition: border-color .12s, background .12s;
}
.tool-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.tool-chip span { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------- FAQ ---------- */
.faq { padding: 50px 0; }
.faq details {
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 9px; background: var(--card);
}
.faq summary {
  padding: 15px 18px; cursor: pointer; font-weight: 700; font-size: 16px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; font-size: 20px; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); font-size: 15px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--petrol-900); color: #8fa9b1; padding: 32px 0; text-align: center; font-size: 14px; }
.site-footer nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.site-footer a { color: #a7c0c7; text-decoration: none; display: inline-block; padding: 12px 8px; }
.site-footer a:hover { color: #fff; }
.footer-note { font-size: 12.5px; color: #6d868e; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) { .calc-grid { grid-template-columns: 1fr; } }

@media (max-width: 700px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 10px 16px; flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .primary-nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-top: 8px; }
  .primary-nav.is-open { display: flex; }
  .primary-nav a { padding: 15px 2px; border-top: 1px solid rgba(255,255,255,.1); }
  .hero { padding: 44px 0 100px; }
  .calc-section { margin-top: -70px; }
  .calc-card, .result-card { padding: 19px; }
  .field-pair { grid-template-columns: 1fr; }
  .section, .faq { padding: 36px 0; }
}
