/* ============================================
   FLIP 2026 - Sistema de Votação
   Prefeitura Municipal de Pintadas
   Escola Zilda Dias
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pmp-green: #0A5C3B;
  --pmp-green-light: #0d7a4f;
  --pmp-green-dark: #074a2f;
  --pmp-blue: #063D8D;
  --pmp-blue-light: #0854b8;
  --pmp-gold: #FFD700;
  --pmp-red: #DD3333;
  --bg-light: #f0faf5;
  --bg-mid: #e8f4f0;
  --text-dark: #333;
  --text-muted: #666;
  --text-light: #999;
  --border-soft: rgba(10, 92, 59, 0.15);
  --shadow-green: rgba(10, 92, 59, 0.2);
}

body {
  font-family: 'Exo 2', ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-mid) 50%, #f0f5fa 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- TOPBAR ---- */
.topbar {
  background: linear-gradient(135deg, var(--pmp-green) 0%, var(--pmp-blue) 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 16px var(--shadow-green);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.topbar-subtitle {
  font-size: 12px;
  opacity: 0.85;
}

/* ---- CONTAINER ---- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---- FOOTER ---- */
.footer {
  background: rgba(255,255,255,0.6);
  border-top: 1px solid var(--border-soft);
  padding: 16px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 40px;
}

/* ---- SCREEN TRANSITIONS ---- */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: slideUp 0.5s ease-out forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes levelUp {
  0%   { opacity: 0; transform: scale(0.3) rotate(-8deg); }
  50%  { opacity: 1; transform: scale(1.08) rotate(2deg); }
  70%  { transform: scale(0.96) rotate(-1deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ---- BADGE ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10,92,59,0.08);
  color: var(--pmp-green);
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
}

/* ---- HEADINGS ---- */
.page-title {
  font-size: clamp(32px, 8vw, 52px);
  color: var(--pmp-green);
  font-weight: 900;
  line-height: 1.1;
  margin: 12px 0 8px;
}

.divider {
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--pmp-green), var(--pmp-blue));
  margin: 16px auto 28px;
  border-radius: 2px;
}

/* ---- TROPHY ICON ---- */
.trophy-icon {
  width: 100px;
  height: 100px;
  margin: 24px auto;
  background: linear-gradient(135deg, var(--pmp-green), var(--pmp-blue));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  animation: float 3s ease-in-out infinite;
  box-shadow: 0 8px 28px var(--shadow-green);
}

/* ---- CARD ---- */
.card {
  background: linear-gradient(135deg, rgba(10,92,59,0.04) 0%, rgba(6,61,141,0.04) 100%);
  border: 2px solid var(--border-soft);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(10,92,59,0.35);
  box-shadow: 0 0 16px rgba(10,92,59,0.12), 0 8px 28px rgba(10,92,59,0.08);
  transform: translateY(-2px);
}

.card-title {
  color: var(--pmp-green);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- INSTRUCTION LIST ---- */
.instruction-list {
  text-align: left;
  margin: 12px 0;
}

.instruction-item {
  display: flex;
  gap: 12px;
  margin: 14px 0;
  align-items: flex-start;
}

.instruction-number {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  background: var(--pmp-green);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.instruction-text {
  flex: 1;
  color: #555;
}

/* ---- CATEGORIES PREVIEW ---- */
.categories-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.category-preview {
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
  transition: all 0.3s ease;
}

.category-preview:hover {
  border-color: var(--pmp-green);
  box-shadow: 0 4px 14px rgba(10,92,59,0.12);
  transform: translateY(-3px);
}

.category-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  background: rgba(10,92,59,0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.category-preview-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--pmp-green);
  margin-bottom: 2px;
}

.category-preview-theme {
  font-size: 11px;
  color: var(--text-light);
}

/* ---- BUTTONS ---- */
.btn {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 24px auto 0;
  padding: 14px 28px;
  background: var(--pmp-green);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Exo 2', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px var(--shadow-green);
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--pmp-green-light);
  box-shadow: 0 6px 20px rgba(10,92,59,0.3);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--pmp-green);
  border: 2px solid var(--pmp-green);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(10,92,59,0.06);
  box-shadow: none;
}

.btn-small {
  max-width: none;
  width: auto;
  display: inline-flex;
  padding: 8px 18px;
  font-size: 13px;
  margin: 0;
  border-radius: 10px;
}

/* ---- STEP INDICATOR ---- */
.step-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
}

.step {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s ease;
}

.step.active {
  background: var(--pmp-green);
  color: #fff;
  box-shadow: 0 0 12px rgba(10,92,59,0.4);
}

.step.completed {
  background: var(--pmp-green);
  color: #fff;
}

.step.pending {
  background: #e0e0e0;
  color: #bbb;
}

.step-line {
  width: 32px;
  height: 3px;
  background: #e0e0e0;
  border-radius: 2px;
}

.step-line.completed {
  background: var(--pmp-green);
}

/* ---- CRITERIA BOX ---- */
.criteria-box {
  background: rgba(10,92,59,0.05);
  border-left: 4px solid var(--pmp-green);
  padding: 14px;
  border-radius: 0 8px 8px 0;
  margin: 16px 0;
}

.criteria-box h4 {
  color: var(--pmp-green);
  font-size: 13px;
  margin-bottom: 10px;
}

.criteria-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.criteria-tag {
  background: #fff;
  border: 1px solid var(--pmp-green);
  color: var(--pmp-green);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

/* ---- CATEGORY HEADER (instruction/voting) ---- */
.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.category-header-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--pmp-green), var(--pmp-blue));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.category-header-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--pmp-green);
  margin: 0;
}

.category-header-theme {
  font-size: 14px;
  font-weight: 600;
  color: var(--pmp-blue);
  margin: 2px 0 0;
}

/* ---- VOTING OPTIONS ---- */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 20px 0;
}

.option {
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: 16px;
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}

.option:hover {
  border-color: var(--pmp-green);
  box-shadow: 0 0 16px rgba(10,92,59,0.15);
}

.option.selected {
  border-color: var(--pmp-green);
  background: linear-gradient(135deg, rgba(10,92,59,0.1) 0%, rgba(6,61,141,0.06) 100%);
  box-shadow: 0 0 20px rgba(10,92,59,0.25);
}

.option-letter {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #f0f0f0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #bbb;
  transition: all 0.3s ease;
}

.option.selected .option-letter {
  background: var(--pmp-green);
  color: #fff;
}

.option-name {
  flex: 1;
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
  transition: color 0.3s ease;
}

.option.selected .option-name {
  color: var(--pmp-green);
}

.option-check {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 2px solid #ddd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: transparent;
  transition: all 0.3s ease;
}

.option.selected .option-check {
  background: var(--pmp-green);
  border-color: var(--pmp-green);
  color: #fff;
}

/* ---- SUCCESS SCREEN ---- */
.success-screen {
  text-align: center;
}

.success-icon {
  width: 112px;
  height: 112px;
  margin: 30px auto;
  background: linear-gradient(135deg, var(--pmp-green), var(--pmp-blue));
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  animation: levelUp 0.8s ease-out forwards;
  box-shadow: 0 12px 36px var(--shadow-green);
}

.success-title {
  font-size: 32px;
  color: var(--pmp-green);
  font-weight: 900;
  margin: 16px 0 8px;
}

.success-subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

/* ---- ADMIN LOGIN ---- */
.login-wrapper {
  max-width: 420px;
  margin: 40px auto;
}

.login-card {
  background: #fff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 2px solid var(--border-soft);
}

.login-card h2 {
  text-align: center;
  color: var(--pmp-green);
  font-size: 22px;
  margin-bottom: 4px;
}

.login-card .login-sub {
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 13px;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Exo 2', sans-serif;
  transition: border-color 0.3s ease;
  background: #fafafa;
}

.form-group input:focus {
  outline: none;
  border-color: var(--pmp-green);
  background: #fff;
}

.error-msg {
  background: #fef2f2;
  color: #c33;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  border-left: 4px solid #c33;
  display: none;
}

.error-msg.visible {
  display: block;
}

/* ---- ADMIN DASHBOARD ---- */
.admin-header {
  background: linear-gradient(135deg, var(--pmp-green) 0%, var(--pmp-blue) 100%);
  color: #fff;
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}

.admin-header p {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}

.stats-summary {
  background: rgba(10,92,59,0.04);
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stats-number {
  font-size: 40px;
  font-weight: 900;
  color: var(--pmp-green);
  line-height: 1;
}

.stats-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin: 20px 0;
}

.result-card {
  background: #fff;
  border: 2px solid var(--border-soft);
  border-radius: 14px;
  padding: 20px;
  transition: box-shadow 0.3s ease;
}

.result-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.result-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.result-card-icon {
  font-size: 24px;
}

.result-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--pmp-green);
}

.result-card-theme {
  font-size: 12px;
  color: var(--text-light);
}

.result-item {
  margin: 14px 0;
}

.result-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.result-label-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
}

.result-label-count {
  font-size: 12px;
  color: var(--text-light);
}

.result-bar {
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.6s ease;
}

.result-bar-fill.green  { background: linear-gradient(90deg, var(--pmp-green), var(--pmp-green-light)); }
.result-bar-fill.blue   { background: linear-gradient(90deg, var(--pmp-blue), var(--pmp-blue-light)); }
.result-bar-fill.red    { background: linear-gradient(90deg, var(--pmp-red), #e85555); }
.result-bar-fill.purple { background: linear-gradient(90deg, #7B2D8B, #9B4DCA); }

.result-percentage {
  font-size: 13px;
  color: var(--pmp-green);
  font-weight: 700;
  margin-top: 4px;
}

.result-total {
  background: rgba(10,92,59,0.04);
  border-left: 4px solid var(--pmp-green);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  margin-top: 14px;
  font-size: 13px;
  color: #555;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 20px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .categories-preview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .category-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 14px;
  }

  .category-icon {
    margin: 0;
  }

  .admin-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .stats-summary {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .category-header {
    flex-direction: column;
    text-align: center;
  }
}
