/* ---------------------------------------------------------------------------
   Bency Motors — thème noir/rouge inspiré du logo (cercle noir, anneau rouge,
   radar, typographie serif pour les titres).
--------------------------------------------------------------------------- */

:root {
  --bg: #0a0a0a;
  --surface: #161616;
  --surface-2: #1f1f1f;
  --border: #2b2b2b;
  --red: #e2231a;
  --red-dark: #a3160f;
  --red-glow: rgba(226, 35, 26, 0.35);
  --white: #f5f3ee;
  --text-muted: #9a9a9a;
  --success: #2fae5c;
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-serif: Georgia, 'Playfair Display', 'Times New Roman', serif;
  --font-sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at 50% -10%, rgba(226, 35, 26, 0.12), transparent 55%),
    var(--bg);
  color: var(--white);
  min-height: 100vh;
  padding-bottom: 3rem;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------------------------------------------------------------------------
   Header
--------------------------------------------------------------------------- */

.app-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 1.25rem;
}

.app-header .logo {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--red), 0 4px 18px var(--red-glow);
  flex-shrink: 0;
}

.app-header h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 0.02em;
}

.header-text .tagline {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---------------------------------------------------------------------------
   Intro banner
--------------------------------------------------------------------------- */

.intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  animation: fade-in 0.4s ease both;
}

/* ---------------------------------------------------------------------------
   Recent searches
--------------------------------------------------------------------------- */

.recent-searches {
  margin-bottom: 1.5rem;
  animation: fade-in 0.4s ease both;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--white);
  margin: 0 0 0.6rem;
}

.recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  font-size: 0.82rem;
  color: var(--white);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.recent-chip:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}

.recent-chip .remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 50%;
}

.recent-chip .remove:hover {
  color: var(--red);
  background: rgba(226, 35, 26, 0.12);
}

/* ---------------------------------------------------------------------------
   Form
--------------------------------------------------------------------------- */

form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  animation: fade-in 0.5s ease both;
}

form .full { grid-column: 1 / -1; }

label {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  color: var(--text-muted);
  gap: 0.35rem;
}

input, select {
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--surface-2);
  color: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: var(--font-sans);
}

input::placeholder { color: #6b6b6b; }

input:focus, select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-glow);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%239a9a9a'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 1.8rem;
}

button[type="submit"] {
  grid-column: 1 / -1;
  position: relative;
  padding: 0.8rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

button[type="submit"]:hover { background: #f13228; box-shadow: 0 4px 18px var(--red-glow); }
button[type="submit"]:active { transform: scale(0.98); }
button[type="submit"]:disabled { opacity: 0.7; cursor: wait; }

.btn-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}

/* ---------------------------------------------------------------------------
   Toast (confirmation message)
--------------------------------------------------------------------------- */

.toast {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(47, 174, 92, 0.12);
  border: 1px solid var(--success);
  color: #7be3a1;
  font-size: 0.88rem;
  animation: slide-in 0.3s ease both;
}

.toast.toast-error {
  background: rgba(226, 35, 26, 0.12);
  border-color: var(--red);
  color: #ff9d97;
}

/* ---------------------------------------------------------------------------
   Results
--------------------------------------------------------------------------- */

#results { margin-top: 1.5rem; }

.placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem 0;
}

.site-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem;
  margin-top: 1rem;
  animation: fade-in-up 0.35s ease both;
}

.site-card h2 {
  font-family: var(--font-serif);
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.confidence-high { border-left: 3px solid var(--success); }
.confidence-low { border-left: 3px solid var(--red); }

.site-card a.btn {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.55rem 1.1rem;
  background: var(--red);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.15s ease, transform 0.1s ease;
}

.site-card a.btn:hover { background: #f13228; transform: translateY(-1px); }

.checklist {
  font-size: 0.85rem;
  margin-top: 0.7rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border);
  padding-top: 0.6rem;
}

.checklist ul { margin: 0.35rem 0 0; padding-left: 1.2rem; }

.note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */

.app-footer {
  max-width: 640px;
  margin: 2.5rem auto 0;
  padding: 0 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: #555;
}

/* ---------------------------------------------------------------------------
   Animations
--------------------------------------------------------------------------- */

@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------------
   Responsive : mobile
--------------------------------------------------------------------------- */

@media (max-width: 560px) {
  form { grid-template-columns: 1fr; padding: 1.1rem; }
  .app-header { padding: 1.4rem 1rem 1rem; }
  .app-header h1 { font-size: 1.3rem; }
  .app-header .logo { width: 44px; height: 44px; }
  main { padding: 0 1rem; }
}

/* ---------------------------------------------------------------------------
   Connexion (code d'accès)
--------------------------------------------------------------------------- */

.login-section {
  max-width: 420px;
  margin: 2rem auto;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.login-section .section-title {
  font-family: var(--font-serif);
  color: var(--white);
  margin-top: 0;
}

.login-section .intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.login-section label {
  display: block;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.login-section input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.7rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--white);
  font-size: 1rem;
}

.login-section button {
  width: 100%;
  padding: 0.75rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.login-section button:hover { background: var(--red-dark); }
.login-section button:disabled { opacity: 0.6; cursor: not-allowed; }

.login-error {
  color: var(--red);
  font-size: 0.85rem;
  margin-top: 0.9rem;
  margin-bottom: 0;
}

.logout-link {
  display: block;
  margin: 0 0 1.25rem auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.logout-link:hover { color: var(--white); }
