/* ============================
   STAKE PAGE STYLES
   ============================ */

/* ---- Page Hero ---- */
.stake-hero {
  position: relative;
  padding: 120px 0 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.stake-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.stake-hero .container {
  position: relative;
  z-index: 1;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 24px;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text-secondary); }

.stake-hero-content {
  max-width: 560px;
  margin-bottom: 32px;
}
.stake-hero-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 12px 0 16px;
}
.stake-hero-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

.stake-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.stake-trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.trust-check {
  width: 20px;
  height: 20px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* ---- Layout ---- */
.stake-main { padding: 48px 0 80px; }
.stake-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: start;
}

/* ---- Network Sidebar ---- */
.network-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 108px);
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.network-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.search-icon { font-size: 0.85rem; opacity: 0.5; }
.network-search input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}
.network-search input::placeholder { color: var(--text-muted); }

.network-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px;
}
.network-list::-webkit-scrollbar { width: 4px; }
.network-list::-webkit-scrollbar-track { background: transparent; }
.network-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.net-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.net-item:hover {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
}
.net-item.active {
  background: rgba(108,99,255,0.1);
  border-color: rgba(108,99,255,0.3);
}
.net-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.net-item-body { flex: 1; min-width: 0; }
.net-item-ticker {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.net-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.net-item-apr {
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex-shrink: 0;
  text-align: right;
}
.net-item-apr-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: right;
}

/* ---- Staking Panel ---- */
.staking-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Steps Bar */
.steps-bar {
  display: flex;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  gap: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s;
}
.step span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}
.step.active .step-dot {
  background: var(--gradient);
  border-color: transparent;
  color: white;
}
.step.active span { color: var(--text-primary); font-weight: 600; }
.step.done .step-dot {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}
.step.done .step-dot::after { content: '✓'; }
.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}

/* Panel Steps */
.panel-step { padding: 32px 28px; }
.panel-step.hidden { display: none; }

/* No selection placeholder */
.no-selection {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-sel-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.no-selection h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.no-selection p { font-size: 0.9rem; line-height: 1.6; }

/* Network selected view */
.selected-network-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(108,99,255,0.08), rgba(72,187,120,0.05));
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.sel-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.sel-info { flex: 1; }
.sel-ticker { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.06em; }
.sel-name { font-size: 1.1rem; font-weight: 700; }
.sel-apr-value {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sel-apr-label { font-size: 0.75rem; color: var(--text-muted); text-align: right; }

.network-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.net-stat {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.net-stat-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.net-stat-value { font-size: 0.95rem; font-weight: 700; }

.validator-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
}
.validator-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 10px; }
.validator-info { display: flex; align-items: center; gap: 12px; }
.validator-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: white;
  flex-shrink: 0;
}
.validator-details { flex: 1; }
.validator-name { font-size: 0.95rem; font-weight: 700; }
.validator-meta { font-size: 0.78rem; color: var(--text-muted); }
.active-status { font-size: 0.78rem; color: var(--green); font-weight: 600; }

/* Step 2 */
.step-back {
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.step-back:hover { color: var(--text-secondary); }
.step-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 24px; }

/* Wallet row */
.wallet-row { margin-bottom: 24px; }
.wallet-disconnected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.wallet-connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(72,187,120,0.06);
  border: 1px solid rgba(72,187,120,0.2);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.wallet-addr { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.wallet-dot { width: 8px; height: 8px; background: var(--green); border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.wallet-bal { color: var(--text-secondary); }
.wallet-bal strong { color: var(--text-primary); }

/* Amount field */
.amount-field { margin-bottom: 24px; }
.amount-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.amount-input-row {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}
.amount-input-row:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(108,99,255,0.1); }
.amount-input {
  flex: 1;
  background: none;
  border: none;
  padding: 16px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  outline: none;
}
.amount-input::placeholder { color: var(--text-muted); font-weight: 400; font-size: 1rem; }
.amount-ticker {
  padding: 0 12px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
}
.max-btn {
  padding: 8px 14px;
  background: var(--purple-light);
  color: var(--purple);
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin: 6px;
  border-radius: 6px;
}
.max-btn:hover { background: rgba(108,99,255,0.2); }

.amount-usd { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; }
.quick-amounts { display: flex; gap: 8px; margin-top: 10px; }
.quick-btn {
  flex: 1;
  padding: 7px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.quick-btn:hover { background: rgba(108,99,255,0.1); border-color: rgba(108,99,255,0.3); color: var(--purple); }

/* Rewards calculator */
.rewards-calculator {
  background: linear-gradient(135deg, rgba(108,99,255,0.06), rgba(72,187,120,0.04));
  border: 1px solid rgba(108,99,255,0.15);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
}
.rewards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.rewards-apr {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 0.9rem;
  font-weight: 700;
}
.rewards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.reward-period {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  text-align: center;
}
.reward-period.highlight-reward {
  background: rgba(72,187,120,0.08);
  border: 1px solid rgba(72,187,120,0.15);
}
.reward-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.reward-value { font-size: 1rem; font-weight: 700; }
.reward-usd { font-size: 0.72rem; color: var(--text-muted); }

/* Step 3 Confirm */
.confirm-summary {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.confirm-row:last-child { border-bottom: none; }
.confirm-label { color: var(--text-muted); }
.confirm-value { font-weight: 600; text-align: right; }
.confirm-network-val { display: flex; align-items: center; gap: 8px; }

.confirm-notice {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255,200,0,0.05);
  border: 1px solid rgba(255,200,0,0.15);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}
.confirm-insurance {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(72,187,120,0.06);
  border: 1px solid rgba(72,187,120,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}
.ins-check { font-size: 1rem; flex-shrink: 0; }

/* ---- Info Strips ---- */
.info-strips {
  padding: 64px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.strips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.info-strip {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.strip-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.strip-content h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.strip-content p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }

/* ---- Stake FAQ ---- */
.stake-faq {
  padding: 80px 0;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 420px;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal-box {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.05);
  border: none;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.modal-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.5; }

.wallet-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.wallet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.wallet-option:hover {
  background: rgba(108,99,255,0.08);
  border-color: rgba(108,99,255,0.3);
}
.wallet-icon { font-size: 1.3rem; }
.wallet-name { flex: 1; }
.wallet-tag {
  background: var(--purple-light);
  color: var(--purple);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
}
.modal-disclaimer {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}
.modal-disclaimer a { color: var(--purple); text-decoration: none; }

/* Success modal */
.success-box { text-align: center; }
.success-icon {
  width: 64px;
  height: 64px;
  background: var(--green-light);
  border: 2px solid var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--green);
  margin: 0 auto 16px;
  font-weight: 700;
}
.success-box h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.success-details {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  font-size: 0.85rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.suc-row { display: flex; justify-content: space-between; }
.suc-label { color: var(--text-muted); }
.suc-val { font-weight: 600; }

/* Loading spinner on stakeNowBtn */
@keyframes spin-btn {
  to { transform: rotate(360deg); }
}
.btn-loading {
  pointer-events: none;
  opacity: 0.8;
}
.btn-loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin-btn 0.7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stake-layout {
    grid-template-columns: 1fr;
  }
  .network-sidebar {
    position: static;
    max-height: 300px;
  }
  .strips-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .strips-grid { grid-template-columns: 1fr; }
  .rewards-grid { grid-template-columns: 1fr; }
  .network-stats-grid { grid-template-columns: 1fr; }
  .steps-bar { padding: 16px; gap: 0; }
  .step span { display: none; }
  .panel-step { padding: 20px 16px; }
}
