:root {
  --bg0: #050712;
  --bg1: #020617;

  --card: rgba(16, 18, 32, 0.92);
  --card2: rgba(255, 255, 255, 0.06);

  --accent: #ff3366;
  --accent-soft: rgba(255, 51, 102, 0.18);
  --accent-2: #ffb347;

  --text: #f9fafb;
  --muted: rgba(249, 250, 251, 0.68);
  --muted2: rgba(249, 250, 251, 0.52);

  --border: rgba(148, 163, 184, 0.22);
  --border-strong: rgba(148, 163, 184, 0.32);

  --danger: #fb7185;
  --success: #4ade80;

  --radius: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;

  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  --shadow-soft: 0 10px 26px rgba(0, 0, 0, 0.28);
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, #1e293b 0, var(--bg1) 40%, #000 100%);
}

body { display: flex; justify-content: center; }

/* App container (commun) */
.app {
  width: 100%;
  max-width: 720px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header (commun) */
.app-header {
  text-align: center;
  padding: 10px 0 6px;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(120deg, #f97316, #ec4899, #8b5cf6);
  -webkit-background-clip: text;
  color: transparent;
}

.app-header p {
  margin: 6px 0 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* Main (commun) */
.app-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card (commun) */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  backdrop-filter: blur(18px);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted2);
}

.card h3 {
  margin: 10px 0 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.hint {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.error-msg {
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Inputs (commun) */
input[type="text"] {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}

input[type="text"]::placeholder { color: rgba(249,250,251,.35); }

input[type="text"]:focus {
  border-color: rgba(255, 51, 102, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 51, 102, 0.12);
}

/* Pills (commun) */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 0.9rem;
  background: rgba(15, 23, 42, 0.85);
  color: var(--muted);
  cursor: pointer;
  transition: transform .12s ease, border-color .16s ease, color .16s ease, background .16s ease;
}

.pill:hover {
  border-color: rgba(255, 51, 102, 0.6);
  color: var(--text);
  transform: translateY(-1px);
}

.pill.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1022;
  border-color: transparent;
  font-weight: 800;
}

/* Buttons (commun) */
.primary-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px 16px;
  font-size: 0.98rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  color: #0b1022;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(255, 51, 102, 0.28);
  transition: transform .10s ease, box-shadow .14s ease, opacity .12s ease;
}

.primary-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
}

.primary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.btn {
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 0.92rem;
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  transition: transform .12s ease, border-color .16s ease, background .16s ease, opacity .12s ease;
}

.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-danger-soft{
  border-color: rgba(251, 113, 133, .30);
  background: rgba(251, 113, 133, .10);
}
.btn-danger-soft:hover{
  border-color: rgba(251, 113, 133, .55);
}

/* Checkbox (commun) */
.option-toggle { margin-top: 10px; }

.option-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.option-toggle input[type="checkbox"] { accent-color: var(--accent); }

/* Footer (commun) */
.site-footer{
  margin-top: auto; /* pousse le footer en bas si la page est courte */
  padding-bottom: calc(14px + env(safe-area-inset-bottom));

  text-align: center;
  opacity: .92;
}

.site-footer .footer-links{
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.site-footer a{
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed rgba(249,250,251,.18);
  transition: opacity .12s ease, color .12s ease, border-color .12s ease;
}

.site-footer a:hover{
  color: var(--text);
  border-bottom-color: rgba(255, 51, 102, .55);
}

/* Responsive */
@media (min-width: 768px) {
  .app { padding: 22px; gap: 16px; }
  .card { padding: 16px 18px; }
}


/* iOS / mobile : évite le blanc en bas + gère la safe-area */
html, body{
  height: auto;
  min-height: 100%;
}

body{
  min-height: 100svh; /* meilleur que 100vh sur mobile */
  background-color: #020617; /* fallback pour éviter le blanc */
  padding-bottom: env(safe-area-inset-bottom);
}

.app{
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.app-main{
  flex: 1; /* remplit l'écran */
}
