/* ========================================
   Voto que Manda — Nova Interface (v2.4)
   Estilo WhatsApp / Mobile-first
   ======================================== */

:root {
  --whatsapp-green: #075E54;
  --whatsapp-dark: #128C7E;
  --whatsapp-light: #25D366;
  --whatsapp-teal: #00A884;
  --bg: #ECE5DD;
  --bg-white: #FFFFFF;
  --bg-chat: #E5DDD5;
  --text: #111B21;
  --text-muted: #667781;
  --text-light: #FFFFFF;
  --border: #E9EDEF;
  --shadow: 0 2px 12px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bottom-nav-h: 64px;
  --header-h: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* === APP CONTAINER === */
#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  background: var(--bg-white);
  box-shadow: 0 0 40px rgba(0,0,0,.08);
  overflow: hidden;
}

/* === SCREENS === */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  background: var(--bg);
}
.screen.active {
  opacity: 1;
  pointer-events: auto;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  background: var(--whatsapp-green);
  color: var(--text-light);
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  z-index: 10;
}
.screen-header .btn-back {
  background: none; border: none; color: var(--text-light);
  font-size: 20px; cursor: pointer; padding: 8px; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.screen-header .btn-back:active { background: rgba(255,255,255,.15); }

.screen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--bottom-nav-h) + 16px);
}

/* === LANDING === */
.landing {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--whatsapp-green) 0%, #064740 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  color: var(--text-light);
}
.landing-brand { text-align: center; margin-bottom: 40px; }
.landing-logo, .landing-logo-img { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 12px; display:block; margin:0 auto 12px; object-fit:cover; }
.landing-logo { background: rgba(255,255,255,.15); display:flex; align-items:center; justify-content:center; font-size: 36px; }
.landing-sub { opacity: .8; font-size: 14px; margin-top: 4px; }

.landing-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.lc-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background .2s;
  border: 1px solid rgba(255,255,255,.1);
}
.lc-card:active { background: rgba(255,255,255,.25); }
.lc-card i { font-size: 24px; width: 32px; text-align: center; }
.lc-card.primary { background: var(--whatsapp-light); border-color: transparent; }

.landing-demo { margin-top: 32px; text-align: center; opacity: .9; font-size: 13px; }
.demo-grid { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.demo-btn {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm); padding: 6px 10px; cursor: pointer;
  color: #fff; font-size: 10px; min-width: 56px;
  transition: background .15s;
}
.demo-btn:active { background: rgba(255,255,255,.25); }
.demo-btn strong { font-size: 12px; }

/* === FORM CARD === */
.form-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}
.form-icon {
  text-align: center; font-size: 36px; color: var(--whatsapp-green);
  margin-bottom: 16px;
}

.field {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 14px;
}
.field span { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.field input {
  width: 100%; padding: 14px 12px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-size: 16px; outline: none;
  transition: border .2s; background: var(--bg-white);
}
.field input:focus { border-color: var(--whatsapp-green); }

.check-field {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; font-size: 14px; cursor: pointer;
}
.check-field input { width: 20px; height: 20px; accent-color: var(--whatsapp-green); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: all .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-block { width: 100%; }
.btn { background: var(--whatsapp-green); color: var(--text-light); }
.btn:active { opacity: .85; }

.feedback {
  margin-top: 10px; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; text-align: center; display: none;
}
.feedback:not(:empty) { display: block; }
.feedback.error { background: #FEF3F2; color: #D92D20; border: 1px solid #FECDCA; }
.feedback.ok { background: #ECFDF3; color: #067647; border: 1px solid #ABF0CE; }

.text-muted { font-size: 13px; color: var(--text-muted); }
a { color: var(--whatsapp-dark); text-decoration: none; }

/* === STEPS === */
.steps {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-bottom: 24px;
}
.step {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  background: var(--border); color: var(--text-muted);
  transition: all .2s;
}
.step.active { background: var(--whatsapp-green); color: #fff; }
.step-line { flex: 1; max-width: 48px; height: 2px; background: var(--border); }
.step.active + .step-line { background: var(--whatsapp-green); }
.reg-step h3 { font-size: 18px; margin-bottom: 16px; }

/* === HOME === */
.home-header { background: var(--whatsapp-green); }
.home-brand { display: flex; align-items: center; gap: 10px; }
.home-logo { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.15); display:flex; align-items:center; justify-content:center; font-size: 16px; flex-shrink:0; }
.home-brand small { display: block; font-weight: 400; font-size: 12px; opacity: .85; }
.btn-icon {
  background: none; border: none; color: #fff; font-size: 20px;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn-icon:active { background: rgba(255,255,255,.15); }

.home-body { padding-bottom: calc(var(--bottom-nav-h) + 80px); }

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.hg-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 16px 8px; background: var(--bg-white);
  border-radius: var(--radius); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: all .15s; font-size: 12px; font-weight: 500;
}
.hg-item:active { transform: scale(.95); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.hg-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
}

/* === POLL PREVIEW === */
.poll-preview {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.poll-preview-header {
  padding: 14px 16px; font-weight: 600; font-size: 14px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.pp-item {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.pp-item:last-child { border-bottom: none; }
.pp-candidate { font-weight: 500; font-size: 14px; }
.pp-count { font-size: 12px; color: var(--whatsapp-green); font-weight: 600; }

/* === BOTTOM NAV === */
.bottom-nav {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-h);
  background: var(--bg-white);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 20;
}
.bn-item {
  background: none; border: none; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-size: 10px; color: var(--text-muted);
  cursor: pointer; padding: 4px 16px; transition: color .15s;
}
.bn-item i { font-size: 22px; }
.bn-item.active, .bn-item:active { color: var(--whatsapp-green); }

/* === TOAST === */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  max-width: 360px; width: 90%;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; text-align: center;
  background: #323232; color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  opacity: 0; transition: all .3s ease;
  z-index: 999; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--whatsapp-green); }
.toast.error { background: #D92D20; }

/* === SECTION CARDS (app screens) === */
.section-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}
.sc-header {
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  background: var(--whatsapp-green);
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.poll-card {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.poll-card:last-child { border-bottom: none; }
.poll-card:active { background: #F0F2F5; }
.pc-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pc-type { font-size: 11px; color: var(--whatsapp-green); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.pc-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.poll-option {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; margin-bottom: 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 14px;
  transition: all .15s;
}
.poll-option:active { border-color: var(--whatsapp-green); background: #F0FAF8; }
.poll-option input { accent-color: var(--whatsapp-green); width: 18px; height: 18px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  margin: 2px;
}
.badge-green { background: #DCF8C6; color: #075E54; }

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.data-row:last-child { border-bottom: none; }
.data-row span { color: var(--text-muted); }

/* === DOC CARDS === */
.doc-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-white); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: all .15s;
}
.doc-card:active { transform: scale(.98); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.doc-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: #6C63FF; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.doc-info { flex: 1; }
.doc-info strong { display: block; font-size: 13px; }
.doc-info small { font-size: 11px; color: var(--text-muted); }
.doc-card .fa-download { color: var(--text-muted); font-size: 14px; }

/* === SCROLLBAR === */
.screen-body::-webkit-scrollbar { width: 4px; }
.screen-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* === RESPONSIVE === */
@media (max-width: 480px) {
  .home-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .hg-icon { width: 42px; height: 42px; font-size: 18px; }
  .hg-item { padding: 12px 4px; font-size: 11px; }
  .landing-cards { max-width: 100%; }
}

/* === UTILITIES === */
.hidden { display: none !important; }
