:root {
  --bg: #080c12;
  --bg-elevated: #0e1520;
  --surface: #161f2e;
  --border: #3d4f66;
  --gold: #d4a853;
  --gold-dark: #b8893a;
  --sage: #5eaa82;
  --sage-dark: #3d8b66;
  --sky: #7eb8da;
  --cream: #f5f0e8;
  --muted: #94a3b8;
  --radius: 1.25rem;
}

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

body.equimind-public {
  margin: 0;
  font-family: "DM Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.equimind-public a { color: var(--sage); text-decoration: none; }
.equimind-public a:hover { text-decoration: underline; }

.page-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(94, 170, 130, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(212, 168, 83, 0.08), transparent),
    var(--bg);
}

.wrap { width: min(1120px, 92vw); margin: 0 auto; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(61, 79, 102, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--cream);
  text-decoration: none;
}

.brand:hover { text-decoration: none; }

.brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--sage), var(--gold-dark));
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.nav-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--cream);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.btn-ghost:hover {
  color: #fff;
  border-color: var(--sage);
  background: rgba(94, 170, 130, 0.08);
}

.btn-primary {
  background: linear-gradient(135deg, var(--sage-dark), #2d6b4f);
  color: #fff;
  box-shadow: 0 4px 20px rgba(94, 170, 130, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4a9a72, #256b4f);
  box-shadow: 0 6px 24px rgba(94, 170, 130, 0.45);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0f0c06;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(212, 168, 83, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #e0b45e, var(--gold));
  box-shadow: 0 6px 24px rgba(212, 168, 83, 0.4);
}

/* Liens-boutons : priorité sur .equimind-public a (couleur sage héritée) */
.equimind-public a.btn,
.equimind-public a.btn:hover {
  text-decoration: none;
}

.equimind-public a.btn-ghost { color: var(--cream); }
.equimind-public a.btn-ghost:hover { color: #fff; }

.equimind-public a.btn-primary,
.equimind-public a.btn-primary:hover { color: #fff; }

.equimind-public a.btn-gold,
.equimind-public a.btn-gold:hover { color: #0f0c06; }

.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 0 2rem;
}

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-split .phone-wrap { order: -1; }
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(94, 170, 130, 0.12);
  border: 1px solid rgba(94, 170, 130, 0.35);
  color: var(--sage);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--gold), var(--sage));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Phone mockup */
.phone-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.phone {
  width: min(320px, 88vw);
  background: #0a0f16;
  border-radius: 2.25rem;
  padding: 0.65rem;
  box-shadow:
    0 0 0 1px rgba(61, 79, 102, 0.5),
    0 24px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.phone-notch {
  width: 36%;
  height: 5px;
  background: #1a2433;
  border-radius: 999px;
  margin: 0.35rem auto 0.5rem;
}

.phone-screen {
  background: linear-gradient(180deg, #0e1520 0%, #080c12 100%);
  border-radius: 1.75rem;
  overflow: hidden;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.5rem;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.95rem;
}

.app-icon-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, var(--sage), var(--gold-dark));
  display: grid;
  place-items: center;
  font-size: 0.9rem;
}

.app-chat-btn {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  background: var(--surface);
  border: 1px solid rgba(61, 79, 102, 0.4);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.app-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.85rem 0.85rem;
}

.app-panel { display: none; }
.app-panel.active { display: block; }

.streak-card {
  padding: 1rem;
  border-radius: 1.1rem;
  background: linear-gradient(135deg, #2a2218, #161f2e);
  border: 1px solid rgba(94, 170, 130, 0.25);
  margin-bottom: 0.75rem;
}

.streak-card strong { font-size: 1.35rem; display: block; }
.streak-card span { font-size: 0.75rem; color: var(--muted); }

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.metric {
  padding: 0.75rem;
  background: rgba(22, 31, 46, 0.9);
  border: 1px solid rgba(61, 79, 102, 0.3);
  border-radius: 0.9rem;
}

.metric label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.metric strong { font-size: 0.95rem; }

.section-title-sm {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0.5rem 0 0.45rem;
}

.reminder-item, .horse-item, .chat-bubble, .doc-item {
  padding: 0.65rem 0.75rem;
  background: rgba(22, 31, 46, 0.85);
  border: 1px solid rgba(61, 79, 102, 0.3);
  border-radius: 0.75rem;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
}

.reminder-item { border-color: rgba(212, 168, 83, 0.35); }
.reminder-item em { color: var(--gold); font-style: normal; font-size: 0.68rem; }

.horse-item.selected { border-color: rgba(94, 170, 130, 0.55); background: rgba(94, 170, 130, 0.1); }

.chat-bubble.user {
  margin-left: 2rem;
  background: rgba(94, 170, 130, 0.15);
  border-color: rgba(94, 170, 130, 0.35);
}

.chat-bubble.ai { margin-right: 1rem; }

.app-tabs {
  display: flex;
  border-top: 1px solid rgba(61, 79, 102, 0.35);
  background: rgba(14, 21, 32, 0.95);
}

.app-tab {
  flex: 1;
  padding: 0.65rem 0.25rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
}

.app-tab.active { color: var(--sage); }

.app-tab span { display: block; font-size: 1rem; margin-bottom: 0.15rem; }

.preview-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.75rem;
}

/* Auth / 2FA pages */
.auth-card {
  width: min(420px, 92vw);
  margin: 3rem auto;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid rgba(61, 79, 102, 0.4);
  border-radius: calc(var(--radius) + 0.25rem);
}

.auth-card h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }
.auth-card p { color: var(--muted); margin: 0 0 1.25rem; font-size: 0.95rem; }

.auth-card label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="email"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(61, 79, 102, 0.5);
  background: var(--bg-elevated);
  color: var(--cream);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.auth-card input:focus {
  outline: 2px solid rgba(94, 170, 130, 0.45);
  border-color: var(--sage);
}

.auth-card .btn { width: 100%; margin-top: 0.5rem; }

.auth-links {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
}

.auth-error {
  padding: 0.75rem 1rem;
  background: rgba(220, 80, 80, 0.12);
  border: 1px solid rgba(220, 80, 80, 0.35);
  border-radius: 0.65rem;
  color: #f0a0a0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.qr-box {
  text-align: center;
  margin: 1rem 0;
  padding: 1rem;
  background: #fff;
  border-radius: 0.75rem;
}

.qr-box img { max-width: 200px; height: auto; }

.secret-code {
  font-family: monospace;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--gold);
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
