/* ============================================================
   PEVYO — Design system
   ============================================================ */

:root {
  --bg: #08080f;
  --surface: #12121f;
  --surface-2: #1a1a2c;
  --border: #26263f;
  --text: #f5f5fa;
  --text-dim: #9ca3af;
  --text-faint: #5b5b76;

  --blue: #3b82f6;
  --purple: #a855f7;
  --pink: #ec4899;
  --accent: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  --accent-solid: #a855f7;

  --cta: #ff3468;
  --cta-hover: #ff5580;
  --yellow: #ffd23f;

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 32px;
}

/* ---------------- Brand ---------------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 40px 0 36px;
}

.brand img {
  width: 64px;
  height: 64px;
}

.brand-word {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  color: var(--text-dim);
  font-size: 14px;
  text-align: center;
}

/* ---------------- Typography ---------------- */
h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ---------------- Form ---------------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-weight: 600;
}

.field input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: border-color .15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent-solid);
}

.field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 6px;
}

.field-error {
  font-size: 12px;
  color: var(--pink);
  margin-top: 6px;
  display: none;
}

.field.error input { border-color: var(--pink); }
.field.error .field-error { display: block; }

/* ---------------- Buttons ---------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-google {
  background: #fff;
  color: #1f1f1f;
}

.btn-google svg { width: 18px; height: 18px; }

.btn-row { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-size: 12px;
  margin: 22px 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------------- Footer link row ---------------- */
.foot-link {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-dim);
}
.foot-link span { color: var(--accent-solid); font-weight: 700; }

.legal-links {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 18px;
  line-height: 1.8;
}
.legal-links a { color: var(--text-dim); text-decoration: underline; }

/* ---------------- OTP input ---------------- */
.otp-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 24px;
}
.otp-row input {
  width: 46px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.otp-row input:focus {
  outline: none;
  border-color: var(--accent-solid);
}

/* ---------------- Checkbox / accept row ---------------- */
.accept-box {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-height: 46vh;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.accept-box h3 {
  color: var(--text);
  font-size: 15px;
  margin: 18px 0 6px;
}
.accept-box h3:first-child { margin-top: 0; }

.accept-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.accept-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent-solid); }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 999;
  max-width: 90%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--pink); }

/* ---------------- Progress dots (onboarding) ---------------- */
.steps {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 32px;
}
.steps .dot {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
}
.steps .dot.active { background: var(--accent-solid); }
.steps .dot.done { background: var(--blue); }

/* ---------------- Bottom nav (app shell) ---------------- */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.app-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
}
.nav-item.active { color: var(--accent-solid); }
.nav-item svg { width: 24px; height: 24px; }
.nav-plus {
  background: var(--accent);
  width: 52px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -4px;
}
.nav-plus svg { width: 20px; height: 20px; color: #fff; }

/* ---------------- Utility ---------------- */
.back-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  cursor: pointer;
}

.center-flex {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 481px) {
  body { background: radial-gradient(circle at 50% 0%, #14142a, var(--bg) 60%); }
}

/* ---------------- Fenêtre modale basique (code 2FA connexion) ---------------- */
.sheet-overlay-basic {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sheet-overlay-basic.open { display: flex; }
.mfa-login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
}
.mfa-login-card h3 { color: var(--text); font-size: 18px; }
.mfa-login-card input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.mfa-login-card input:focus { outline: none; border-color: var(--accent-solid); }
