:root {
  --akile-green: #1D9E75;
  --akile-green-dark: #0F6E56;
  --akile-green-light: #E1F5EE;
  --akile-blue: #185FA5;
  --akile-blue-light: #E6F1FB;
  --akile-amber: #BA7517;
  --akile-amber-light: #FAEEDA;
  --akile-red: #A32D2D;
  --akile-red-light: #FCEBEB;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e0e0e0;
  --bg: #f5f5f5;
  --white: #fff;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px;
}

/* Header */
.header {
  background: var(--akile-green);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h1 { font-size: 17px; font-weight: 600; flex: 1; }
.header .back { font-size: 22px; cursor: pointer; }
.header .action { font-size: 14px; background: rgba(255,255,255,0.2); padding: 6px 12px; border-radius: 20px; cursor: pointer; border: none; color: white; }

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
  box-shadow: var(--shadow);
}

/* PIN input */
.pin-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 24px;
  background: white;
}
.pin-logo { font-size: 48px; margin-bottom: 8px; }
.pin-title { font-size: 24px; font-weight: 700; color: var(--akile-green); margin-bottom: 4px; }
.pin-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 40px; }
.pin-dots { display: flex; gap: 16px; margin-bottom: 32px; }
.pin-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); background: white; transition: all 0.2s; }
.pin-dot.filled { background: var(--akile-green); border-color: var(--akile-green); }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 280px; }
.pin-key {
  height: 64px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-key:active { background: var(--akile-green-light); border-color: var(--akile-green); transform: scale(0.95); }
.pin-key.delete { font-size: 18px; color: var(--text-muted); }
.pin-error { color: var(--akile-red); font-size: 14px; margin-top: 16px; }

/* Home */
.greeting { padding: 20px 16px 4px; font-size: 22px; font-weight: 700; }
.greeting-sub { padding: 0 16px 16px; font-size: 14px; color: var(--text-muted); }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 16px 16px; }
.stat-card { background: white; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-val { font-size: 28px; font-weight: 700; color: var(--akile-green); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Imovel selector */
.imovel-list { margin: 0 16px; }
.imovel-item {
  background: white;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}
.imovel-item:active { transform: scale(0.98); }
.imovel-icon { width: 44px; height: 44px; background: var(--akile-green-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.imovel-nome { font-size: 15px; font-weight: 500; }
.imovel-end { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.imovel-apto { font-size: 11px; background: var(--akile-green-light); color: var(--akile-green-dark); padding: 2px 8px; border-radius: 10px; margin-left: auto; flex-shrink: 0; }

/* Checklist */
.secao-header {
  padding: 12px 16px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.item-card {
  background: white;
  margin: 0 16px 8px;
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.item-desc { font-size: 14px; font-weight: 500; margin-bottom: 10px; line-height: 1.4; }
.item-foto-badge { display: inline-block; font-size: 11px; background: var(--akile-blue-light); color: var(--akile-blue); padding: 2px 8px; border-radius: 10px; margin-bottom: 10px; }

/* Botões de resposta */
.resp-btns { display: flex; gap: 8px; }
.resp-btn {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
}
.resp-btn:active { transform: scale(0.97); }
.resp-btn.sel-ok { background: var(--akile-green-light); border-color: var(--akile-green); color: var(--akile-green-dark); }
.resp-btn.sel-nao { background: var(--akile-red-light); border-color: var(--akile-red); color: var(--akile-red); }
.resp-btn.sel-faltando { background: var(--akile-amber-light); border-color: var(--akile-amber); color: var(--akile-amber); }

/* Checkbox */
.check-btn {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.check-btn.done { background: var(--akile-green-light); border-color: var(--akile-green); color: var(--akile-green-dark); }

/* Foto upload */
.foto-area {
  margin-top: 10px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.foto-area.has-foto { border-color: var(--akile-green); background: var(--akile-green-light); }
.foto-area input[type=file] { display: none; }
.foto-preview { width: 100%; max-height: 160px; object-fit: cover; border-radius: 8px; }
.foto-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Progress bar */
.progress-bar-wrap { background: rgba(255,255,255,0.3); border-radius: 4px; height: 4px; margin: 0 20px 4px; }
.progress-bar-fill { height: 100%; background: white; border-radius: 4px; transition: width 0.3s; }
.progress-text { font-size: 12px; color: rgba(255,255,255,0.85); padding: 0 20px 12px; }

/* Bottom CTA */
.bottom-cta {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid var(--border);
  z-index: 100;
}
.btn-primary {
  width: 100%;
  height: 52px;
  background: var(--akile-green);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary:active { transform: scale(0.98); background: var(--akile-green-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Resumo final */
.resumo-icon { text-align: center; font-size: 56px; margin: 24px 0 8px; }
.resumo-titulo { text-align: center; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.resumo-sub { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.ocorr-item { background: var(--akile-red-light); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; font-size: 13px; color: var(--akile-red); }
.ocorr-empty { background: var(--akile-green-light); border-radius: 10px; padding: 12px; text-align: center; font-size: 14px; color: var(--akile-green-dark); margin-bottom: 16px; }

/* Search */
.search-box { margin: 12px 16px; position: relative; }
.search-box input { width: 100%; height: 44px; border-radius: 12px; border: 1.5px solid var(--border); padding: 0 16px 0 40px; font-size: 14px; background: white; outline: none; }
.search-box input:focus { border-color: var(--akile-green); }
.search-box::before { content: '🔍'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; }

/* Loading */
.loading { text-align: center; padding: 40px 20px; color: var(--text-muted); font-size: 14px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--akile-green); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: #333; color: white; padding: 10px 20px; border-radius: 20px; font-size: 13px; z-index: 999; animation: fadeInOut 2.5s forwards; }
@keyframes fadeInOut { 0%{opacity:0;transform:translateX(-50%) translateY(10px)} 15%{opacity:1;transform:translateX(-50%) translateY(0)} 75%{opacity:1} 100%{opacity:0} }
