/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ── */
:root {
  --bg:        #080c14;
  --bg2:       #0d1422;
  --bg3:       #111827;
  --card:      #0f1a2e;
  --border:    #1e2d45;
  --border2:   #243552;
  --accent:    #38bdf8;
  --accent2:   #7c3aed;
  --accent3:   #22c55e;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --muted2:    #94a3b8;
  --danger:    #ef4444;
  --warning:   #f97316;
  --gold:      #f59e0b;
  --radius:    10px;
  --radius-lg: 16px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4 { font-family: 'Syne', sans-serif; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p  { color: var(--muted2); }

/* ── Navigation ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.2rem;
  color: white; text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--muted2); text-decoration: none;
  padding: 8px 14px; border-radius: 8px;
  font-size: 0.9rem; font-weight: 500;
  transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: white; background: var(--border); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-user { font-size: 0.85rem; color: var(--muted2); }
.nav-plan {
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700;
}
.plan-free    { background: var(--border); color: var(--muted2); }
.plan-premium { background: #0369a122; color: #38bdf8; border: 1px solid #0369a144; }
.plan-pro     { background: #7c3aed22; color: #a78bfa; border: 1px solid #7c3aed44; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; border: none; transition: all 0.2s; text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--accent); color: #080c14; }
.btn-primary:hover { background: #7dd3fc; transform: translateY(-1px); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--border2); }
.btn-pro       { background: linear-gradient(135deg, var(--accent2), #4f46e5); color: white; }
.btn-pro:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline   { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: #080c14; }
.btn-danger    { background: transparent; color: var(--danger); border: 1px solid var(--danger)44; }
.btn-danger:hover { background: var(--danger)11; }
.btn-sm { padding: 7px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.card:hover { border-color: var(--border2); }

/* ── Inputs ── */
input, select, textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { cursor: pointer; }
select option { background: var(--bg3); }
label { display: block; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }

/* ── Form groups ── */
.form-group { margin-bottom: 14px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 0.75em; font-weight: 700;
}
.badge-buy     { background: #16a34a33; color: #22c55e; }
.badge-sell    { background: #dc262633; color: #f87171; }
.badge-neutre  { background: #ca8a0433; color: #facc15; }
.badge-pro-tag { background: var(--accent2); color: white; font-size: 0.7em; padding: 2px 8px; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Upload zones ── */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted2);
  font-size: 0.9rem;
  background: var(--bg2);
}
.drop-zone:hover { border-color: var(--accent); color: var(--accent); background: #38bdf808; }
.drop-zone.loaded { border-color: var(--accent3); color: var(--accent3); }

/* ── Model selector ── */
.model-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.model-btn {
  padding: 10px 8px; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--bg2);
  color: var(--muted2); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-weight: 600; font-size: 0.82em;
  text-align: center; transition: all 0.2s;
}
.model-btn:hover:not(.locked) { border-color: var(--accent); color: white; }
.model-btn.active { border-color: var(--accent); color: var(--accent); background: #38bdf808; }
.model-btn.locked { opacity: 0.4; cursor: not-allowed; }
.model-tag { display: block; font-size: 0.7em; font-weight: 400; margin-top: 2px; }
.tag-free    { color: var(--muted); }
.tag-premium { color: #38bdf8; }
.tag-pro     { color: #a78bfa; }

/* ── Result display ── */
.result-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px; margin-top: 14px;
  text-align: left; line-height: 1.7;
}
.result-section { margin-bottom: 12px; border-left: 3px solid var(--accent); padding-left: 12px; }
.result-label { color: var(--accent); font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; font-weight: 600; }
.proba-row { display: flex; align-items: center; gap: 10px; }
.proba-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }

/* ── Quota bar ── */
.quota-bar {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; font-size: 0.85rem;
}
.quota-track { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.quota-fill  { height: 100%; border-radius: 3px; transition: width 0.4s; }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); z-index: 500;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 520px; width: 100%;
  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-box h2 { font-family: 'Syne', sans-serif; color: var(--accent); margin-bottom: 6px; }

/* ── Auth tabs ── */
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tab {
  flex: 1; padding: 9px; border-radius: var(--radius);
  cursor: pointer; background: var(--border); color: var(--muted2);
  font-weight: 600; border: none; font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.auth-tab.active { background: var(--accent); color: #080c14; }

/* ── Plans cards ── */
.plans-grid { display: flex; gap: 14px; margin: 20px 0; }
.plan-card {
  flex: 1; background: var(--bg2); border-radius: var(--radius-lg);
  padding: 20px 16px; border: 2px solid var(--border); transition: border 0.2s;
}
.plan-card:hover { border-color: var(--border2); }
.plan-card.popular { border-color: var(--accent2)66; }
.plan-card .price { font-family: 'Syne', sans-serif; font-size: 1.8em; font-weight: 800; }
.plan-card ul { list-style: none; padding: 0; margin: 12px 0; font-size: 0.85em; color: var(--muted2); text-align: left; }
.plan-card ul li { padding: 3px 0; }
.plan-card ul li::before { content: "✓ "; color: var(--accent); }
.plan-price-old { color: var(--muted); font-size: 0.8em; text-decoration: line-through; }
.plan-economy { font-size: 0.72em; color: var(--accent3); margin-bottom: 12px; }

/* ── Loader ── */
.loader { display: none; text-align: center; padding: 16px; color: var(--muted2); font-size: 0.9rem; }
.loader::after {
  content: '';
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--border2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  margin-left: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page layout ── */
.page { padding-top: 64px; min-height: 100vh; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 600px; margin: 0 auto; padding: 0 24px; }

/* ── Section header ── */
.section-label {
  font-size: 0.78em; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}

/* ── Glow effects ── */
.glow-blue { box-shadow: 0 0 30px #38bdf811; }
.glow-purple { box-shadow: 0 0 30px #7c3aed11; }

/* ── Responsive ── */
@media (max-width: 640px) {
  nav { padding: 0 16px; }
  .nav-links { display: none; }
  .plans-grid { flex-direction: column; }
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }
  .container { padding: 0 16px; }
}

/* ── Utilities ── */
.hidden  { display: none !important; }
.mt-4    { margin-top: 16px; }
.mt-6    { margin-top: 24px; }
.mt-8    { margin-top: 32px; }
.mb-4    { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--muted2); }
.text-accent { color: var(--accent); }
.text-green  { color: var(--accent3); }
.text-red    { color: var(--danger); }
.flex        { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.w-full { width: 100%; }
