@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #07070b;
  --bg-2: #0e0e15;
  --panel: #12121b;
  --panel-2: #1a1a26;
  --border: #262636;
  --text: #ececf3;
  --muted: #8b8ba3;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.center-text { text-align: center; }
.hidden { display: none !important; }

/* ---------- boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .75em 1.25em; border-radius: 10px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.danger { background: var(--danger); }
.btn.small { padding: .45em .8em; font-size: .875rem; }

label { display: block; font-size: .85rem; color: var(--muted); margin: 0 0 .35em; font-weight: 500; }
input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%; padding: .7em .85em; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font: inherit;
  outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 1rem; }
.error { color: var(--danger); font-size: .875rem; min-height: 1.2em; margin: .5em 0 0; }
.success { color: var(--ok); }

/* ---------- landing ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px max(16px, calc((100vw - 1100px) / 2));
}
.logo { font-weight: 800; font-size: 1.3rem; color: var(--text); letter-spacing: -.03em; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }
.nav-actions { display: flex; gap: .5rem; }

.hero {
  text-align: center; padding: 90px 16px 60px;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(139, 92, 246, .25), transparent 70%);
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; line-height: 1.05; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 2rem; }

.claim {
  display: flex; max-width: 480px; margin: 0 auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 6px; align-items: center;
}
.claim .prefix { padding-left: .8em; color: var(--muted); white-space: nowrap; }
.claim input { border: 0; background: transparent; padding-left: 0; min-width: 0; }
.claim-status { font-size: .9rem; min-height: 1.4em; margin-top: .8rem; }

.features {
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  max-width: 1100px; margin: 0 auto; padding: 40px 16px 80px;
}
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature .emoji { font-size: 1.6rem; }
.feature h3 { margin: .5em 0 .3em; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.footer { text-align: center; color: var(--muted); padding: 30px 16px; font-size: .85rem; border-top: 1px solid var(--border); }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; width: 100%; max-width: 400px; }
.panel h1 { font-size: 1.6rem; }
.tabs { display: flex; background: var(--bg-2); border-radius: 10px; padding: 4px; margin-bottom: 1.4rem; }
.tabs button {
  flex: 1; padding: .6em; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600; cursor: pointer;
}
.tabs button.active { background: var(--panel-2); color: var(--text); }
.input-prefix { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); }
.input-prefix:focus-within { border-color: var(--accent); }
.input-prefix span { padding-left: .85em; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.input-prefix input { border: 0; background: transparent; padding-left: .1em; }
.hint { font-size: .8rem; margin-top: .35em; min-height: 1.1em; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: 230px 1fr 380px; min-height: 100vh; }
.dash > * { min-width: 0; }
.card-box code { overflow-wrap: anywhere; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--border); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar .logo { padding: 0 10px 18px; }
.sidebar button {
  display: flex; align-items: center; gap: .7em; text-align: left; width: 100%;
  padding: .7em .8em; border-radius: 9px; border: 0; background: transparent;
  color: var(--muted); font: inherit; font-weight: 500; cursor: pointer;
}
.sidebar button:hover { background: var(--panel); color: var(--text); }
.sidebar button.active { background: var(--panel-2); color: var(--text); }
.sidebar .spacer { flex: 1; }
.sidebar .me { padding: 10px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--border); margin-top: 8px; }
.sidebar .me b { color: var(--text); }

.content { padding: 28px; overflow-y: auto; max-height: 100vh; }
.content h2 { font-size: 1.4rem; }
.section { display: none; }
.section.active { display: block; }
.card-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.card-box h3 { font-size: 1rem; margin-bottom: 1em; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 1.5rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .8rem; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); padding: 3px; cursor: pointer; }
.color-row code { color: var(--muted); font-size: .85rem; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.range-label { display: flex; justify-content: space-between; }

.toggle { display: flex; align-items: center; justify-content: space-between; padding: .55em 0; border-bottom: 1px solid var(--border); }
.toggle:last-child { border-bottom: 0; }
.toggle span { color: var(--text); font-size: .95rem; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: var(--border); border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch i::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

.media { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.media:last-child { border-bottom: 0; }
.media .thumb {
  width: 64px; height: 64px; border-radius: 10px; background: var(--bg-2) center/cover no-repeat;
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted); font-size: 1.4rem; flex: none; overflow: hidden;
}
.media .thumb video { width: 100%; height: 100%; object-fit: cover; }
.media .info { flex: 1; min-width: 0; }
.media .info b { display: block; }
.media .info small { color: var(--muted); }

.link-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 8px; margin-bottom: 8px; }

.code-box { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; letter-spacing: .15em; background: var(--bg-2); border: 1px dashed var(--accent); border-radius: 10px; padding: .5em 1em; display: inline-block; }

.preview { border-left: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.preview iframe { flex: 1; width: 100%; border: 0; background: #000; }

.savebar {
  position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 140%);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 10px 10px 18px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5); transition: transform .25s; z-index: 50;
}
.savebar.show { transform: translate(-50%, 0); }

.toast {
  position: fixed; top: 20px; right: 20px; background: var(--panel-2); border: 1px solid var(--border);
  border-left: 3px solid var(--ok); padding: 12px 16px; border-radius: 10px; z-index: 60;
  opacity: 0; transform: translateY(-10px); transition: .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast.err { border-left-color: var(--danger); }

.notice {
  background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .4); color: #fca5a5;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: .92rem;
}
.notice.warn { background: rgba(249, 115, 22, .1); border-color: rgba(249, 115, 22, .4); color: #fdba74; }

.badge-group { font-size: .95rem; margin: 1.6rem 0 .8rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.badge-card {
  display: flex; gap: 14px; align-items: flex-start; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
}
.badge-card.owned { border-color: rgba(139, 92, 246, .55); background: #17142a; }
.badge-card img { width: 40px; height: 40px; flex: none; }
.badge-card:not(.owned) img { opacity: .45; filter: grayscale(.6); }
.badge-card .bc-body { min-width: 0; }
.badge-card .bc-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.badge-card .bc-tag { font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: rgba(34, 197, 94, .15); color: var(--ok); }
.badge-card p { margin: .35em 0 0; font-size: .87rem; line-height: 1.45; }
.badge-card .bc-how { color: var(--muted); }
.badge-card .bc-how b { color: var(--text); font-weight: 500; }

.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 1rem 0 16px; }
.pack {
  display: flex; flex-direction: column; gap: 10px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.pack.featured { border-color: rgba(139, 92, 246, .6); }
.pack-head { display: flex; align-items: center; gap: 10px; }
.pack-head img { width: 32px; height: 32px; }
.pack-head b { font-size: 1.05rem; }
.pack-price { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.pack-price small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.pack p { margin: 0; color: var(--muted); font-size: .9rem; }
.pack ul { margin: 0; padding-left: 1.1em; font-size: .88rem; line-height: 1.7; flex: 1; }
.steps { margin: 0; padding-left: 1.2em; line-height: 1.9; }
.code-inline { font-family: 'JetBrains Mono', monospace; background: var(--bg-2); border: 1px dashed var(--accent); padding: 1px 8px; border-radius: 6px; }
.order-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; flex-wrap: wrap; }
.order-row:last-child { border-bottom: 0; }
.order-row .grow { flex: 1; min-width: 140px; }
.status { font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; }
.status.pending { background: rgba(234, 179, 8, .15); color: #facc15; }
.status.delivered { background: rgba(34, 197, 94, .15); color: var(--ok); }
.status.cancelled { background: rgba(239, 68, 68, .15); color: #f87171; }

.premium-box { border-color: rgba(139, 92, 246, .45); }
.premium-box h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.premium-lock { font-size: .78rem; font-weight: 500; color: var(--muted); }
.premium-box.locked .field, .premium-box.locked .toggle { opacity: .5; }
.perks { margin: .4rem 0 0; padding-left: 1.2em; line-height: 1.8; font-size: .9rem; }

.mobile-nav { display: none; }

@media (max-width: 1150px) {
  .dash { grid-template-columns: 210px 1fr; }
  .preview { display: none; }
}
@media (max-width: 760px) {
  .dash { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav { display: flex; gap: 6px; overflow-x: auto; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2); position: sticky; top: 0; z-index: 10; }
  .mobile-nav button { flex: none; padding: .5em .9em; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: inherit; font-size: .85rem; }
  .mobile-nav button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .content { padding: 16px; max-height: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat .v { font-size: 1.15rem; }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row select { grid-column: 1 / -1; }
}
