/* =============================================================
   JySerai.bf — View-specific styles
   ============================================================= */

/* ---------- HEADER ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  padding: 8px 14px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.site-nav a:hover { color: var(--text); background: var(--accent-soft); }
.site-nav a.active { color: var(--accent); background: var(--accent-soft); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: clamp(60px, 10vw, 120px) 0 clamp(40px, 6vw, 80px);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .6;
  background:
    radial-gradient(600px 400px at 15% 20%, var(--accent-soft) 0%, transparent 60%),
    radial-gradient(700px 500px at 85% 60%, var(--accent-soft) 0%, transparent 65%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.hero h1 {
  margin: 20px 0 24px;
}
.hero h1 .accent-word {
  font-style: italic;
  color: var(--accent);
  position: relative;
  white-space: nowrap;
}
.hero h1 .accent-word::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M0 4 Q 25 0 50 4 T 100 4' stroke='%23d4a017' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat center/100% 100%;
  opacity: .8;
}

.hero-lead {
  font-size: clamp(16px, 1.2vw, 18px);
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 32px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: clamp(20px, 4vw, 48px);
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.hero-stat .value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-strong);
  line-height: 1;
}
.hero-stat .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 6px;
}

/* Hero visual — stacked frame preview */
.hero-visual {
  position: relative;
  aspect-ratio: 1;
  max-width: 520px;
  justify-self: center;
  width: 100%;
}
.hero-frame-stack {
  position: absolute;
  inset: 0;
}
.hero-frame {
  position: absolute;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-slow) var(--ease-out);
}
.hero-frame img { width: 100%; height: 100%; object-fit: cover; }

.hero-frame.f1 {
  inset: 0 20% 20% 0;
  transform: rotate(-4deg);
  z-index: 3;
}
.hero-frame.f2 {
  inset: 12% 0 8% 15%;
  transform: rotate(3deg);
  z-index: 2;
  opacity: .85;
}
.hero-frame.f3 {
  inset: 25% 12% 0 8%;
  transform: rotate(-1deg);
  z-index: 1;
  opacity: .6;
}
.hero-visual:hover .f1 { transform: rotate(-2deg) translateY(-6px); }
.hero-visual:hover .f2 { transform: rotate(2deg) translateY(-3px); }

.hero-badge {
  position: absolute;
  bottom: 4%;
  right: -6%;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 14px 20px;
  border-radius: var(--r-md);
  font-weight: 600;
  transform: rotate(4deg);
  box-shadow: var(--shadow-brand);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-sans);
}
.hero-badge .b-count { font-size: 22px; font-weight: 700; }
.hero-badge .b-lbl { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 380px; margin: 0 auto; }
  .hero-stats { flex-wrap: wrap; }
}

/* ---------- SECTION ---------- */
.section { padding: clamp(56px, 8vw, 100px) 0; position: relative; }
.section-head {
  max-width: 720px;
  margin: 0 auto var(--s-10);
  text-align: center;
}
.section-head .eyebrow { justify-content: center; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--text-muted); font-size: 17px; }

/* ---------- HOW IT WORKS ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step {
  position: relative;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med);
}
.step:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.step-num {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 300;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -.04em;
  margin-bottom: 16px;
  opacity: .35;
}
.step h3 { margin-bottom: 8px; font-size: 20px; }
.step p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* ---------- PRICING ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.plan {
  position: relative;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition: transform var(--dur-med) var(--ease-out), border-color var(--dur-med), box-shadow var(--dur-med);
  display: flex;
  flex-direction: column;
}
.plan:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.plan.featured {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-color: var(--accent);
  box-shadow: var(--shadow-brand);
}
.plan.featured::before {
  content: 'Populaire';
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-fg);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.plan-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}
.plan-tier {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.plan-tier.free { background: var(--surface-2); color: var(--text-muted); }
.plan-tier.silver { background: linear-gradient(135deg, #c0c0c0, #808080); color: #1a1108; }
.plan-tier.gold { background: linear-gradient(135deg, #f4c430, #b8860b); color: #1a1108; }
.plan-tier.diamond { background: linear-gradient(135deg, #b9f2ff, #4b9dfe); color: #0a1e2e; }

.plan-price {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--text-strong);
}
.plan-price .cur { font-size: 15px; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.plan-price.free { color: var(--success); }
.plan-quota {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.plan-quota b { color: var(--text); font-weight: 600; }

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  flex: 1;
}
.plan-features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.4;
}
.plan-features li::before {
  content: '';
  flex-shrink: 0;
  width: 16px; height: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  margin-top: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d4a017' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 10px;
}

@media (max-width: 1000px) {
  .pricing { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .pricing { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px 24px;
  transition: border-color var(--dur-fast);
}
.faq details[open] { border-color: var(--accent); }
.faq summary {
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--text-strong);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 24px;
  color: var(--accent);
  font-weight: 300;
  transition: transform var(--dur-fast);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- CTA BAND ---------- */
.cta-band {
  padding: clamp(48px, 8vw, 80px) clamp(32px, 5vw, 64px);
  background:
    radial-gradient(circle at 30% 40%, var(--accent-soft-strong) 0%, transparent 50%),
    var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::before, .cta-band::after {
  content: '';
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}
.cta-band::before { top: -120px; left: -80px; }
.cta-band::after { bottom: -120px; right: -80px; }
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin-bottom: 16px; }
.cta-band p { color: var(--text-muted); font-size: 17px; margin-bottom: 32px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  margin-top: var(--s-16);
  color: var(--text-muted);
  font-size: 13px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 32px;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--text-muted); transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--accent); }
.footer-brand p { max-width: 320px; line-height: 1.6; margin-top: 12px; }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- CREATE FLOW ---------- */
.create-shell {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
.create-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.create-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.create-panel h3 {
  font-size: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.create-panel .field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin-bottom: 8px;
}
.create-panel .field-label .val { color: var(--accent); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.tool-btn {
  padding: 10px 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all var(--dur-fast);
  display: grid;
  place-items: center;
  gap: 4px;
}
.tool-btn:hover { background: var(--surface); border-color: var(--border-strong); }
.tool-btn.active {
  background: var(--accent-soft-strong);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 1000px) {
  .create-shell { grid-template-columns: 1fr; }
  .create-panel { position: static; }
}

/* Editor stage */
.stage {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  background:
    repeating-conic-gradient(var(--surface-2) 0% 25%, var(--bg-sunken) 0% 50%) 50%/22px 22px;
}
.stage-photo {
  position: absolute;
  overflow: hidden;
  cursor: grab;
}
.stage-photo.dragging { cursor: grabbing; }
.stage-photo img {
  position: absolute;
  transform-origin: center center;
  pointer-events: none;
  max-width: none;
  top: 50%; left: 50%;
}
.stage-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.stage-frame img { width: 100%; height: 100%; }

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 48px 32px;
  text-align: center;
  background: var(--accent-soft);
  cursor: pointer;
  transition: all var(--dur-med);
  min-width: 320px;
  position: relative;
  z-index: 5;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft-strong);
  transform: scale(1.02);
}
.dropzone .up-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-brand);
}
.dropzone h4 { font-size: 18px; margin-bottom: 6px; color: var(--text-strong); font-family: var(--font-sans); }
.dropzone p { font-size: 13px; color: var(--text-muted); }

/* Frame gallery (choose template) */
.frame-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.frame-thumb {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all var(--dur-fast);
}
.frame-thumb img { width: 100%; height: 100%; object-fit: cover; }
.frame-thumb:hover { border-color: var(--border-strong); transform: scale(1.02); }
.frame-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.frame-thumb .lbl {
  position: absolute;
  bottom: 6px; left: 6px; right: 6px;
  padding: 4px 8px;
  background: rgba(0,0,0,.7);
  color: white;
  border-radius: var(--r-xs);
  font-size: 11px;
  text-align: center;
  backdrop-filter: blur(4px);
}

/* ---------- DASHBOARD (my campaigns) ---------- */
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.campaign-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--dur-med) var(--ease-out);
}
.campaign-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.campaign-thumb {
  aspect-ratio: 1;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-sunken);
  position: relative;
}
.campaign-body { padding: 16px 18px; }
.campaign-title { font-weight: 600; margin-bottom: 6px; font-size: 15px; color: var(--text-strong); }
.campaign-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.campaign-actions {
  display: flex;
  gap: 6px;
}

/* Share link box */
.share-box {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.share-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}
.share-box button {
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}

/* Quota bar for user */
.quota-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.quota-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.quota-info { flex: 1; }
.quota-info .label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.quota-info .label b { color: var(--text); }

/* Admin stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.stat-card .value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text-strong);
}
.stat-card .value .unit {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 4px;
  font-family: var(--font-sans);
}
.stat-card.accent .value { color: var(--accent); }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- LOGIN GATE ---------- */
.gate-wrap {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}
.gate {
  max-width: 420px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 40px 32px;
  text-align: center;
}
.gate .gate-icon {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.gate h2 { font-size: 24px; margin-bottom: 8px; }
.gate p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

/* ---------- PARTICIPANT PAGE ---------- */
.participant-header {
  text-align: center;
  padding: 40px 0 24px;
}
.participant-header .host {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
}
.participant-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 12px;
}
.participant-header p { color: var(--text-muted); max-width: 560px; margin: 0 auto; font-size: 15px; }
