@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --sky: #eef4f7;
  --sky-deep: #dbe9ef;
  --glass: #2b7a8c;
  --glass-light: #7fc4d4;
  --glass-pane: rgba(127, 196, 212, 0.35);
  --charcoal: #1e2530;
  --charcoal-soft: #4a5568;
  --amber: #e8a33d;
  --amber-soft: #fdf1de;
  --white: #ffffff;
  --line: #d7e3e8;
  --ok: #2f9e63;
  --err: #c0503b;

  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  color: var(--charcoal);
  font-family: var(--font-body);
  min-height: 100vh;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 28px 20px 80px; }

/* ---------- Header ---------- */
.brand-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px;
}
.brand-name {
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--charcoal-soft);
}
.badge-status {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 5px 12px; border-radius: 100px; background: var(--white); color: var(--glass); border: 1px solid var(--line);
}

/* ---------- Hero: janela de vidro que preenche com o progresso ---------- */
.hero {
  background: var(--white); border-radius: 20px; padding: 32px 28px; margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(30,37,48,0.06), 0 12px 32px rgba(30,37,48,0.06);
}
.hero-greeting { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--charcoal-soft); margin: 0 0 2px; }
.hero-client { font-family: var(--font-display); font-weight: 600; font-size: 30px; margin: 0 0 20px; }
.hero-obra { font-family: var(--font-body); font-size: 14px; color: var(--charcoal-soft); margin-top: -14px; margin-bottom: 20px; }

.janela-progresso { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.janela-svg-wrap { flex-shrink: 0; }
.janela-pct { font-family: var(--font-display); font-size: 42px; font-weight: 600; line-height: 1; }
.janela-pct-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--charcoal-soft); margin-top: 4px; }
.janela-etapa-atual { font-family: var(--font-body); font-size: 15px; margin-top: 10px; }
.janela-etapa-atual b { color: var(--glass); }

/* ---------- Seções ---------- */
.section-title {
  font-family: var(--font-display); font-weight: 500; font-size: 19px; margin: 32px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .eyebrow {
  font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--glass); background: var(--glass-pane); padding: 3px 8px; border-radius: 6px;
}

.card { background: var(--white); border-radius: 16px; padding: 20px 22px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(30,37,48,0.05); }

/* ---------- Timeline ("Diário da Obra") ---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -28px; top: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center;
}
.tl-item.done .tl-dot { border-color: var(--ok); background: var(--ok); }
.tl-item.active .tl-dot { border-color: var(--amber); background: var(--amber-soft); }
.tl-item.done .tl-dot::after { content: '✓'; color: white; font-size: 11px; }
.tl-nome { font-weight: 600; font-size: 14.5px; }
.tl-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--charcoal-soft); margin-top: 2px; }
.tl-obs { font-size: 13px; color: var(--charcoal-soft); margin-top: 4px; }
.tl-fotos { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tl-fotos a { font-family: var(--font-mono); font-size: 10.5px; background: var(--glass-pane); color: var(--glass); padding: 3px 9px; border-radius: 6px; text-decoration: none; }

/* ---------- Forms ---------- */
label { display: block; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--charcoal-soft); margin-bottom: 6px; }
input, textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: var(--font-body); font-size: 14px; background: var(--sky); color: var(--charcoal); margin-bottom: 14px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--glass); outline-offset: 1px; }

button.btn {
  font-family: var(--font-body); font-weight: 600; font-size: 14px; padding: 12px 22px; border-radius: 100px;
  border: none; background: var(--glass); color: white; cursor: pointer;
}
button.btn:hover { background: #236679; }
button.btn.secondary { background: var(--white); color: var(--glass); border: 1.5px solid var(--glass); }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Estrelas ---------- */
.estrelas { display: flex; gap: 6px; font-size: 30px; cursor: pointer; margin-bottom: 16px; }
.estrelas span { color: var(--line); transition: color 0.15s; }
.estrelas span.ativa { color: var(--amber); }

/* ---------- Assinatura ---------- */
canvas#assinatura-canvas { width: 100%; height: 160px; border: 1.5px dashed var(--line); border-radius: 12px; background: var(--sky); touch-action: none; }

/* ---------- Empty/loading ---------- */
.empty { text-align: center; padding: 40px 20px; color: var(--charcoal-soft); font-size: 14px; }
.loading-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; font-family: var(--font-display); font-size: 18px; color: var(--charcoal-soft); }

.chip { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 3px 10px; border-radius: 100px; }
.chip.ok { background: #e3f5ea; color: var(--ok); }
.chip.warn { background: var(--amber-soft); color: #a5680f; }
.chip.err { background: #fbe8e4; color: var(--err); }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--charcoal); color: white; padding: 12px 20px; border-radius: 100px; font-size: 13.5px; z-index: 50;
}
.toast.err { background: var(--err); }

@media (max-width: 480px) {
  .janela-progresso { gap: 16px; }
  .janela-pct { font-size: 32px; }
}
