/* ─────────────────────────────────────────────
   modal.css — Auth modal + Vote modal styles
   ───────────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Both .open and .active show the overlay at full opacity */
.modal-overlay.open,
.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-overlay.active .modal,
.modal-overlay.open .modal {
  animation: modalIn 0.25s ease;
}

.modal {
  background: var(--off-black);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 1.25rem; right: 1.25rem;
  background: none;
  border: none;
  color: var(--white3);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}
.modal-close:hover { color: var(--white); }

/* ── Auth Modal Header ── */
.modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}
.modal-logo img {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.modal-logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.modal .sub-heading {
  font-size: 0.85rem;
  color: var(--white2);
  margin-bottom: 2rem;
}

/* ── Tabs ── */
.modal-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.75rem;
}
.modal-tab {
  flex: 1;
  padding: 0.55rem;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: none;
  color: var(--white3);
}
.modal-tab.active {
  background: var(--green);
  color: var(--black);
  font-weight: 700;
}

/* ── Error ── */
.modal-error {
  padding: 0.65rem 0.85rem;
  background: rgba(255,85,85,0.1);
  border: 1px solid rgba(255,85,85,0.3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #ff8888;
  margin-bottom: 1rem;
  display: none;
}

/* ── Age / 18+ Checkbox ── */
.age-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.85rem;
  background: rgba(127,255,127,0.04);
  border: 1px solid rgba(127,255,127,0.15);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  cursor: pointer;
}
.age-check input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--green);
  flex-shrink: 0;
  margin-top: 2px;
}
.age-check-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--white2);
  line-height: 1.5;
}
.age-check-text strong { color: var(--green); }

.disclaimer-small {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--white3);
  line-height: 1.5;
  margin-top: 0.75rem;
  text-align: center;
}

/* ── Success State ── */
.modal-success {
  text-align: center;
  padding: 1.5rem 0;
}
.modal-success .check  { font-size: 3rem; margin-bottom: 1rem; }
.modal-success h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 0.5rem;
}
.modal-success p {
  color: var(--white2);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}
.tokens-granted {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1.25rem;
  background: rgba(127,255,127,0.1);
  border: 1px solid rgba(127,255,127,0.3);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--green);
  margin-bottom: 1.5rem;
}

/* ── Vote Modal ── */
.market-question {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.35;
}

/* Mobile keyboard handling for inputs in modals */
@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end !important;
  }
  
  .modal {
    max-height: 85vh !important;
  }
  
  /* Ensure form inputs don't cause zoom on iOS */
  .modal input[type="number"],
  .modal input[type="text"],
  .modal input[type="email"],
  .modal input[type="password"] {
    font-size: 16px !important;
  }
  
  /* Vote modal specific improvements */
  #vote-amount-slider {
    min-height: 44px;
    touch-action: pan-y;
  }
  
  .outcome-btn {
    min-height: 60px;
  }
}
.vote-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.vote-option {
  padding: 1.25rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  background: none;
  color: var(--white);
}
.vote-option.yes:hover,
.vote-option.yes.selected {
  border-color: var(--green);
  background: rgba(127,255,127,0.08);
  color: var(--green);
}
.vote-option.no:hover,
.vote-option.no.selected {
  border-color: #ff8888;
  background: rgba(255,85,85,0.08);
  color: #ff8888;
}
.vote-balance-line {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--white3);
  margin-bottom: 1rem;
}
