/* perso/styles.css */

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

:root {
  --g1: #7B2FBE;
  --g2: #00D4FF;
  --font: 'Poppins', sans-serif;
}

body {
  font-family: var(--font);
  min-height: 100vh;
  background: #0D0D1A;
  color: #fff;
  overflow-x: hidden;
}

/* ── FOND ─────────────────────────────────────────────── */
.bg-gradient {
  position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(123,47,190,.35) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(0,212,255,.20) 0%, transparent 60%);
  pointer-events: none;
}
.bg-particles { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.particle {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.06);
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  from { transform: translateY(0) scale(1); opacity:.06; }
  to   { transform: translateY(-100vh) scale(1.3); opacity:0; }
}

/* ── HEADER ───────────────────────────────────────────── */
.page-header {
  position: relative; z-index: 10;
  display: flex; align-items: center;
  padding: 16px 20px;
}
.logo-container { display: flex; align-items: center; gap: 8px; }
.logo-container img { border-radius: 8px; }
.logo-text {
  font-size: 18px; font-weight: 800;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ── MAIN ─────────────────────────────────────────────── */
.page-main {
  position: relative; z-index: 5;
  max-width: 480px; margin: 0 auto;
  padding: 8px 16px 120px;
}

/* ── STEPS ────────────────────────────────────────────── */
.step { animation: fadeSlideIn .4s ease; }
.hidden { display: none !important; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARD SAISIE ──────────────────────────────────────── */
.card {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(16px);
}
.card-header {
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  text-align: center;
}
.header-emoji { font-size: 40px; margin-bottom: 8px; }
.card-title { font-size: 22px; font-weight: 800; color: #fff; }
.card-subtitle { font-size: 13px; color: rgba(255,255,255,.78); margin-top: 4px; line-height: 1.5; }
.card-body { padding: 24px; }

/* ── SÉLECTEUR THÈME ──────────────────────────────────── */
.theme-section {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.theme-label { font-size: 13px; font-weight: 600; color: rgba(255,255,255,.55); white-space: nowrap; }
.theme-picker { display: flex; gap: 10px; }
.theme-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 2.5px solid transparent;
  cursor: pointer; transition: transform .2s, border-color .2s;
}
.theme-btn:hover { transform: scale(1.10); }
.theme-btn.active {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}

/* ── INPUT ────────────────────────────────────────────── */
.input-group { margin-bottom: 20px; }
.input-label { display: block; font-size: 12px; font-weight: 600; color: rgba(255,255,255,.55); margin-bottom: 6px; letter-spacing: .5px; }
.name-input {
  width: 100%; padding: 14px 16px;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 14px;
  color: #fff; font-family: var(--font); font-size: 15px; font-weight: 600;
  outline: none; transition: border-color .2s;
}
.name-input::placeholder { color: rgba(255,255,255,.30); font-weight: 400; }
.name-input:focus { border-color: var(--g1); }

/* ── BOUTON GÉNÉRER ───────────────────────────────────── */
.generate-btn {
  width: 100%; height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border: none; border-radius: 14px;
  color: #fff; font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity .2s, transform .15s;
}
.generate-btn:disabled { opacity: .35; cursor: not-allowed; }
.generate-btn:not(:disabled):hover { transform: translateY(-2px); }
.generate-btn:not(:disabled):active { transform: scale(.97); }
.btn-icon { font-size: 18px; }

/* ── CARTE RÉSULTAT ───────────────────────────────────── */
.result-card {
  background: rgba(20,10,40,.85);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 24px; overflow: hidden;
  backdrop-filter: blur(20px);
  margin-bottom: 16px;
}
.result-header {
  padding: 28px 24px 20px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  text-align: center;
}
.result-emoji { font-size: 40px; margin-bottom: 6px; }
.result-name { font-size: 26px; font-weight: 900; color: #fff; }
.result-subtitle { font-size: 12px; color: rgba(255,255,255,.78); margin-top: 4px; }

/* ── SCORES ───────────────────────────────────────────── */
.scores-container { padding: 20px 20px 8px; }
.score-row { margin-bottom: 18px; }
.score-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.score-emoji { font-size: 18px; }
.score-label { flex: 1; font-size: 14px; font-weight: 700; color: #fff; }
.score-percent {
  font-size: 20px; font-weight: 900;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.bar-track {
  height: 10px; background: rgba(255,255,255,.08);
  border-radius: 5px; overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0%; border-radius: 5px;
  background: linear-gradient(90deg, var(--g1), var(--g2));
  transition: width 1.2s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 2px 8px rgba(123,47,190,.4);
}

/* ── FOOTER RÉSULTAT ──────────────────────────────────── */
.result-footer {
  padding: 12px 20px;
  background: rgba(123,47,190,.08);
  border-top: 1px solid rgba(255,255,255,.07);
  text-align: center;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,.45);
  display: flex; flex-direction: column; gap: 2px;
}
.footer-arrows { font-size: 14px; }

/* ── ACTIONS ──────────────────────────────────────────── */
.actions-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 10px;
  margin-bottom: 14px;
}
.action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 8px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  color: #fff; font-family: var(--font); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .2s, transform .15s;
}
.action-btn:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }
.action-btn:active { transform: scale(.95); }
.action-icon { font-size: 22px; }

.restart-btn {
  width: 100%; padding: 14px;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 14px;
  color: rgba(255,255,255,.55); font-family: var(--font); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: border-color .2s, color .2s;
  margin-bottom: 28px;
}
.restart-btn:hover { border-color: rgba(255,255,255,.40); color: #fff; }

/* ── SECTION TÉLÉCHARGEMENT ───────────────────────────── */
.download-section {
  position: relative; z-index: 5;
  max-width: 480px; margin: 0 auto;
  padding: 0 16px 40px;
  text-align: center;
}
.flat-counter {
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,.45);
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.flat-dots { display: flex; gap: 4px; }
.flat-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--g1); opacity: .4;
  animation: pulse 1.8s ease-in-out infinite;
}
.flat-dot:nth-child(2) { animation-delay: .3s; background: var(--g2); }
.flat-dot:nth-child(3) { animation-delay: .6s; }
@keyframes pulse {
  0%,100% { opacity: .3; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.4); }
}
.download-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border: none; border-radius: 16px;
  color: #fff; font-family: var(--font); font-size: 15px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 6px 20px rgba(123,47,190,.40);
  transition: transform .15s, box-shadow .15s;
  width: 100%; justify-content: center;
}
.download-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(123,47,190,.50); }
.download-btn:active { transform: scale(.97); }
.download-icon { font-size: 22px; }

/* ── MENU FLOTTANT ────────────────────────────────────── */
.fab-menu {
  position: fixed; bottom: 24px; right: 20px; z-index: 100;
}
.fab-main {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, var(--g1), var(--g2));
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 6px 20px rgba(123,47,190,.45);
  transition: transform .2s;
}
.fab-main:hover { transform: scale(1.08); }
.fab-items {
  position: absolute; bottom: 62px; right: 0;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; pointer-events: none;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s;
}
.fab-menu.open .fab-items { opacity: 1; pointer-events: all; transform: translateY(0); }
.fab-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(20,10,40,.95);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  color: #fff; font-family: var(--font); font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .2s;
}
.fab-item:hover { background: rgba(123,47,190,.35); }
.fab-item-icon { font-size: 18px; }

/* ── TOAST ────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(20,10,40,.95);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 12px 20px;
  font-size: 13px; font-weight: 600; color: #fff;
  opacity: 0; transition: opacity .3s, transform .3s;
  z-index: 200; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }


.fab-main {
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
/* ── HEADER NAV ──────────────────────────────────────── */
.header-nav {
  display: flex; align-items: center; gap: 6px;
  margin-left: auto;
}
.nav-link, .nav-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff; font-size: 18px; cursor: pointer;
  text-decoration: none; transition: background .2s, transform .15s;
  font-family: inherit;
}
.nav-link:hover, .nav-btn:hover { background: rgba(255,255,255,.16); transform: scale(1.08); }
.lang-wrapper { position: relative; }
.lang-dropdown {
  position: absolute; top: 46px; right: 0;
  background: rgba(20,10,40,.98);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 8px;
  min-width: 170px; z-index: 200;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.lang-dropdown button {
  background: none; border: none; color: #fff;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  padding: 10px 14px; border-radius: 10px; cursor: pointer; text-align: left;
  transition: background .15s;
}
.lang-dropdown button:hover { background: rgba(123,47,190,.35); }

/* ── INPUT HINT ──────────────────────────────────────── */
.input-hint { display:block; font-size:12px; color: rgba(255,165,0,.8); margin-top:4px; min-height:16px; }
.name-input.input-error { border-color: rgba(255,100,100,.6); }

/* ── FOOTER BRAND ────────────────────────────────────── */
.footer-brand {
  text-align: center; font-size: 12px; font-weight: 400;
  color: rgba(255,255,255,.25); margin-top: 14px;
}

/* ── LIGHT MODE ──────────────────────────────────────── */
body.light-mode {
  background: #F0EFF8; color: #1A1A2E;
}
body.light-mode .bg-gradient {
  background: radial-gradient(ellipse at 20% 20%, rgba(123,47,190,.15) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(0,212,255,.10) 0%, transparent 60%);
}
body.light-mode .card,
body.light-mode .result-card {
  background: rgba(255,255,255,.95);
  border-color: rgba(0,0,0,.08);
}
body.light-mode .name-input {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.12);
  color: #1A1A2E;
}
body.light-mode .name-input::placeholder { color: rgba(0,0,0,.30); }
body.light-mode .score-label { color: #1A1A2E; }
body.light-mode .bar-track { background: rgba(0,0,0,.06); }
body.light-mode .action-btn {
  background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.08); color: #1A1A2E;
}
body.light-mode .action-btn:hover { background: rgba(0,0,0,.10); }
body.light-mode .restart-btn { border-color: rgba(0,0,0,.15); color: rgba(0,0,0,.50); }
body.light-mode .restart-btn:hover { border-color: rgba(0,0,0,.35); color: #1A1A2E; }
body.light-mode .logo-text {
  background: linear-gradient(135deg, var(--g1), var(--g2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
body.light-mode .nav-link, body.light-mode .nav-btn {
  background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.10); color: #1A1A2E;
}
body.light-mode .lang-dropdown {
  background: #fff; border-color: rgba(0,0,0,.10);
}
body.light-mode .lang-dropdown button { color: #1A1A2E; }
body.light-mode .flat-counter { color: rgba(0,0,0,.45); }
body.light-mode .footer-brand { color: rgba(0,0,0,.25); }
body.light-mode .result-footer { background: rgba(123,47,190,.06); }
body.light-mode .result-footer span { color: rgba(0,0,0,.40); }
body.light-mode .toast {
  background: rgba(240,239,248,.98); border-color: rgba(0,0,0,.10); color: #1A1A2E;
}

/* ── RESPONSIVE MOBILE ───────────────────────────────── */
@media (max-width: 400px) {
  .page-main { padding: 4px 12px 100px; }
  .card-body { padding: 18px; }
  .actions-grid { gap: 8px; }
  .action-btn { padding: 12px 4px; font-size: 11px; }
  .generate-btn { font-size: 14px; }
}
