/* ============================================================
   Invite / wallet UI — redesigned premium dark theme.
   Class names are preserved so view.js keeps working.
============================================================ */

:root {
  --bg-0: #07070b;
  --bg-1: #0c0c14;
  --card-bg: rgba(18, 18, 28, 0.72);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-border-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #ffffff;
  --text-secondary: #a8acb8;
  --text-tertiary: #6b6f7d;
  --accent: #7c5cff;
  --accent-2: #00e0c6;
  --accent-grad: linear-gradient(135deg, #7c5cff 0%, #00e0c6 100%);
  --hero-cta: #c8ef44;
  --hero-cta-hover: #d6ff5a;
  --hero-ring: rgba(200, 239, 68, 0.4);
  --sol: #14f195;
  --evm: #627eea;
  --danger: #ff5c7c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --t: 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
}

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

html, body {
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.text-white { color: #fff; }

/* ---------- Backgrounds ---------- */
.bg-bokeh {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: var(--bg-0);
}
.bg-bokeh--hero {
  background:
    radial-gradient(ellipse 600px 480px at 15% 12%, rgba(124, 92, 255, 0.22), transparent 65%),
    radial-gradient(ellipse 520px 520px at 85% 82%, rgba(0, 224, 198, 0.16), transparent 68%),
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.03), transparent 55%),
    var(--bg-0);
}
.bg-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* ---------- Page ---------- */
.invite-page {
  position: relative; display: flex; min-height: 100vh; width: 100%;
  align-items: center; justify-content: center; overflow: hidden;
  padding: 24px;
}

/* ---------- Card ---------- */
.invite-card {
  position: relative; z-index: 10;
  width: 100%; max-width: 380px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px 22px;
  text-align: center;
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--shadow);
  transition: border-color var(--t), transform var(--t);
}
.invite-card:hover { border-color: var(--card-border-hover); }

.invite-card--hero {
  width: min(92%, 580px); max-width: 580px;
  background: transparent; border: none; border-radius: 0; padding: 48px 24px;
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.invite-card--hero:hover { border: none; }

/* ---------- Hero ---------- */
.invite-hero { display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero-brand-mark {
  position: relative; width: 120px; height: 120px;
  margin: 0 auto 36px; display: flex; align-items: center; justify-content: center;
}
.hero-brand-ring {
  position: absolute; border-radius: 50%;
  border: 1px dashed var(--hero-ring); pointer-events: none;
  animation: spin 14s linear infinite;
}
.hero-brand-ring--outer { inset: 0; opacity: 0.5; }
.hero-brand-ring--inner { inset: 16px; opacity: 0.85; animation-direction: reverse; animation-duration: 9s; }
.hero-brand-core {
  position: relative; z-index: 1; width: 68px; height: 68px; border-radius: 50%;
  background: linear-gradient(160deg, #15151f, #0c0c14);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 0 30px rgba(124, 92, 255, 0.25);
}
.hero-brand-core img, .hero-brand-logo { width: 46px; height: 46px; object-fit: contain; }

.hero-title {
  margin: 0 0 18px; display: flex; flex-direction: column; gap: 2px;
  font-family: var(--font-display);
  font-size: clamp(30px, 6vw, 44px); font-weight: 700; line-height: 1.05;
  letter-spacing: -0.035em; color: var(--text-primary);
}
.hero-title-line { display: block; }
.hero-title-line:nth-child(2) {
  background: linear-gradient(120deg, #c8ef44, #00e0c6 60%, #7c5cff);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.hero-description {
  max-width: 460px; margin: 0 auto 34px;
  font-size: 15.5px; line-height: 1.6; color: var(--text-secondary); font-weight: 400;
}

.hero-cta-wrap { display: flex; justify-content: center; width: 100%; }

/* ---------- Buttons ---------- */
.btn {
  display: block; width: 100%; padding: 14px 18px;
  font-family: var(--font-sans); font-size: 14px; font-weight: 600;
  line-height: normal; border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; text-align: center;
  border: 1px solid transparent;
  transition: opacity var(--t), background var(--t), border-color var(--t), transform 0.18s ease, box-shadow var(--t);
}
.btn:active { transform: translateY(0); }

.btn-hero {
  width: auto; min-width: 220px; padding: 16px 44px;
  border: none; border-radius: 999px;
  background: var(--hero-cta); color: #0a0a0a;
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  box-shadow: 0 10px 30px rgba(200, 239, 68, 0.28), 0 0 0 1px rgba(200, 239, 68, 0.1);
}
.btn-hero:hover { background: var(--hero-cta-hover); transform: translateY(-2px); box-shadow: 0 14px 38px rgba(200, 239, 68, 0.36); }

.btn-primary {
  background: var(--accent-grad); color: #fff; border: none;
  height: 48px; padding: 0 16px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.28);
}
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); box-shadow: 0 12px 30px rgba(124, 92, 255, 0.36); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.02); color: #fff;
  border: 1px solid var(--card-border); height: 48px; padding: 0 16px;
  display: flex; align-items: center; justify-content: center; font-weight: 500;
}
.btn-secondary:hover { border-color: var(--card-border-hover); background: rgba(255, 255, 255, 0.05); }

.btn-connect { gap: 10px; font-weight: 600; }
.btn-connect svg { flex-shrink: 0; }

.btn-stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Logo container ---------- */
.logo-container {
  margin-bottom: 18px; display: flex; justify-content: center; align-items: center; height: 32px;
}

/* ---------- Typography helpers ---------- */
.invite-card h1 {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; letter-spacing: -0.02em;
  margin-bottom: 12px; color: var(--text-primary); line-height: 1.25;
}
.description {
  font-size: 14px; line-height: 1.6; color: var(--text-secondary);
  margin-bottom: 28px; font-weight: 400;
}
.invite-description { text-align: left; margin-bottom: 0; line-height: 1.55; letter-spacing: -0.01em; }
.wallet-step-description { max-width: 320px; margin: 0 auto 22px; font-size: 13.5px; line-height: 1.55; }

/* ---------- Chain picker ---------- */
.chain-picker-label {
  width: 100%; margin-bottom: 10px; text-align: left;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.chain-picker {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-bottom: 18px;
}
.chain-picker-card {
  display: flex; flex-direction: row; align-items: center; gap: 10px;
  padding: 12px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--card-border); background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary); font-family: inherit; cursor: pointer; text-align: left;
  transition: border-color var(--t), background var(--t), color var(--t), transform 0.18s ease;
}
.chain-picker-card:hover { border-color: var(--card-border-hover); background: rgba(255, 255, 255, 0.05); transform: translateY(-1px); }
.chain-picker-card.active {
  color: var(--text-primary);
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.14), rgba(0, 224, 198, 0.08));
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.18), 0 8px 24px rgba(124, 92, 255, 0.12);
}
.chain-picker-icon { flex-shrink: 0; opacity: 0.85; transition: opacity var(--t); }
.chain-picker-card.active .chain-picker-icon { opacity: 1; }
.chain-picker-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chain-picker-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.chain-picker-subtitle { font-size: 10.5px; line-height: 1.35; color: var(--text-tertiary); }

/* ---------- Wallet connect wraps ---------- */
.wallet-connect-wrap { position: relative; width: 100%; }

.wallet-connect-wrap-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; pointer-events: none;
}
.wallet-dual-panel-preload {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; pointer-events: none;
}
.wallet-dual-panel .btn-stack { position: relative; }
.wallet-connect-blocked .btn-primary { pointer-events: none; }
.wallet-connect-loading {
  position: absolute; inset: 0; pointer-events: all; cursor: wait; opacity: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: #fff; font-weight: 600;
  border-radius: var(--radius-sm);
  z-index: 2;
}

/* ---------- Animated views ---------- */
.animated-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.animated-view.active { opacity: 1; transform: translateY(0); }

.checkmark-wrapper { position: relative; margin-bottom: 24px; width: 56px; height: 56px; }
.spinner-ring {
  position: absolute; top: 0; left: 0; width: 56px; height: 56px;
  border: 2px solid rgba(255, 255, 255, 0.08); border-top-color: var(--accent-2);
  border-radius: 50%; animation: spin 1s linear infinite;
}
.success-icon-bg {
  position: absolute; top: 3px; left: 3px; width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(160deg, #15151f, #0c0c14);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--card-border);
  color: var(--accent-2);
}

/* ---------- Powered by (optional, unused but kept) ---------- */
.powered-by { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--card-border); }
.powered-by span { font-size: 11px; color: var(--text-tertiary); letter-spacing: 0.02em; }
.powered-by-logo { display: block; height: 14px; width: auto; opacity: 0.9; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .invite-card { padding: 24px 18px; }
  .chain-picker { grid-template-columns: 1fr 1fr; }
}
