@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@600;900&family=DM+Sans:wght@300;400;500&display=swap');

#mva-app {
  font-family: 'DM Sans', sans-serif;
  max-width: 520px;
  margin: 2rem auto;
  padding: 0 1rem;
  color: #1a1410;
}

.mva-card {
  background: #fffdf8;
  border: 1px solid #d8d0c4;
  border-radius: 14px;
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(26,20,16,.08);
  margin-bottom: 1rem;
}

.mva-logo { font-size: 3rem; text-align: center; margin-bottom: .5rem; }
.mva-card h2 {
  font-family: 'Fraunces', serif;
  font-weight: 900;
  font-size: 1.8rem;
  text-align: center;
  margin: 0 0 .25rem;
}
.mva-sub { text-align: center; color: #7a6e62; font-size: .95rem; margin-bottom: 1.25rem; }
.mva-hint { text-align: center; font-size: .8rem; color: #7a6e62; margin-top: .75rem; }

/* PIN inputs */
.mva-pin-row { display: flex; gap: .5rem; justify-content: center; margin: 1rem 0; }
.mva-pin-digit, .mva-pin-digit2 {
  width: 58px; height: 68px;
  font-size: 1.8rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  text-align: center;
  border: 2px solid #d8d0c4;
  border-radius: 10px;
  background: #f5f0e8;
  outline: none;
  transition: border-color .15s;
  color: #1a1410;
}
.mva-pin-digit:focus, .mva-pin-digit2:focus { border-color: #1a1410; }

/* Buttons */
.mva-btn {
  display: inline-block;
  padding: .85rem 1.75rem;
  border-radius: 8px;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.mva-btn:active { transform: scale(0.98); }
.mva-btn-primary   { background: #1a1410; color: #f5f0e8; }
.mva-btn-secondary { background: #2d6a4f; color: white; }
.mva-btn-primary:hover, .mva-btn-secondary:hover { opacity: .85; }
.mva-btn-link { background: none; border: none; color: #c8441a; font-size: .9rem; cursor: pointer; padding: 0; text-decoration: underline; font-family: 'DM Sans', sans-serif; }

/* Alerts */
.mva-alert { padding: .75rem 1rem; border-radius: 8px; font-size: .9rem; margin-bottom: .75rem; }
.mva-alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.mva-alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.mva-alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Header bar */
.mva-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .5rem;
}
.mva-member-name { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600; }
.mva-badge {
  display: inline-block;
  background: #fde8b0;
  color: #7a4a00;
  padding: .15rem .55rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  margin-left: .4rem;
}

/* Live badge */
.mva-live-badge {
  display: inline-block;
  background: #c8441a;
  color: white;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: .75rem;
  animation: mva-pulse 2s infinite;
}
@keyframes mva-pulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.mva-card h2.vote-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  margin: 0 0 .25rem;
}

.mva-divider { border: none; border-top: 1px solid #d8d0c4; margin: 1.25rem 0; }

/* Vote options */
.mva-options { display: grid; gap: .65rem; margin: 1rem 0; }
.mva-option {
  width: 100%;
  padding: .9rem 1.25rem;
  border: 2px solid #d8d0c4;
  border-radius: 10px;
  background: #fffdf8 !important;
  color: #1a1410 !important;
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: .75rem;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}
.mva-option:hover { border-color: #1a1410; background: #f5f0e8 !important; color: #1a1410 !important; }
.mva-option.selected { border-color: #2d6a4f; background: #eaf4ef !important; color: #1a1410 !important; }
.mva-option-circle {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #d8d0c4;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s;
}
.mva-option.selected .mva-option-circle { border-color: #2d6a4f; background: #2d6a4f; }
.mva-option.selected .mva-option-circle::after { content: '✓'; color: white; font-size: .8rem; font-weight: 700; }

/* Waiting */
.mva-waiting { text-align: center; padding: 3rem 2rem; }
.mva-spinner {
  width: 48px; height: 48px;
  border: 3px solid #d8d0c4;
  border-top-color: #c8441a;
  border-radius: 50%;
  animation: mva-spin 1s linear infinite;
  margin: 0 auto 1rem;
}
@keyframes mva-spin { to { transform: rotate(360deg); } }

/* Result bars */
.mva-result-item { margin-bottom: 1rem; }
.mva-result-label { display: flex; justify-content: space-between; margin-bottom: .3rem; font-size: .95rem; }
.mva-result-track { background: #f5f0e8; border-radius: 4px; height: 20px; overflow: hidden; border: 1px solid #d8d0c4; }
.mva-result-fill  { height: 100%; background: #2d6a4f; border-radius: 4px; transition: width 1s ease; }

/* Mobile */
@media (max-width: 480px) {
  .mva-card { padding: 1.5rem; }
  .mva-pin-digit, .mva-pin-digit2 { width: 50px; height: 60px; font-size: 1.5rem; }
}
