:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #1f2933;
  --muted: #617084;
  --accent: #0b66c3;
  --accent-2: #0f8a5f;
  --danger: #be123c;
  --border: #d5dee8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef3f8 0%, #f8fafc 60%, #ffffff 100%);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  background: #0d1b2a;
  border-bottom: 1px solid #15273b;
}

.topbar-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.logo {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.nav {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.nav a {
  color: #dbe7f5;
  text-decoration: none;
  font-size: 0.95rem;
}

.lang-switch {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.lang-switch a {
  color: #dbe7f5;
  text-decoration: none;
  border: 1px solid #37506a;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.4px;
}

.lang-switch a.active {
  background: #0b66c3;
  border-color: #0b66c3;
  color: #fff;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.hero h1 {
  margin-top: 0;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.flash {
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  margin: 0.5rem 0;
  border: 1px solid transparent;
}

.flash-success {
  background: #eafaf1;
  color: #166534;
  border-color: #bbf7d0;
}

.flash-error {
  background: #fff1f2;
  color: #9f1239;
  border-color: #fecdd3;
}

.flash-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.btn {
  display: inline-block;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.inline-form,
.action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: #fff;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

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

.narrow {
  max-width: 560px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat h2 {
  margin-bottom: 0;
}

.device {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
}

.device-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
}

.device-info {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.device-media {
  flex: 0 0 auto;
}

.device-photo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.device-photo-placeholder {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.4rem;
}

.device-photo-panel {
  margin-top: 0.8rem;
}

.device-photo-large {
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8fafc;
}

.category-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}

.cat-telephone {
  background: #e6f4ff;
  color: #04518f;
  border-color: #b6dcfb;
}

.cat-electromenager {
  background: #edfdf3;
  color: #156a3d;
  border-color: #b6f2d0;
}

.cat-informatique {
  background: #f1ecff;
  color: #4a348e;
  border-color: #d3c5ff;
}

.cat-tv_audio {
  background: #fff3e9;
  color: #8f4c08;
  border-color: #ffd7b2;
}

.cat-autre {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.link-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.link-card span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.6rem 0.35rem;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cta-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.feature-list {
  margin: 0;
  padding-left: 1.1rem;
}

@media (max-width: 820px) {
  .stats {
    grid-template-columns: 1fr;
  }

  .grid-form {
    grid-template-columns: 1fr;
  }

  .device-head {
    flex-direction: column;
  }

  .device-info {
    width: 100%;
  }

  .topbar-inner {
    align-items: flex-start;
  }

  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
  }

  .nav a {
    white-space: nowrap;
    background: #11273c;
    border: 1px solid #223f59;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
  }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form input,
  .inline-form select,
  .inline-form button,
  .inline-form .btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0.75rem;
  }

  .card {
    padding: 0.85rem;
  }

  .cta-row .btn,
  .stack .btn,
  .grid-form > .btn {
    width: 100%;
    text-align: center;
  }

  .device-info {
    flex-direction: column;
  }

  .device-photo,
  .device-photo-placeholder {
    width: 100%;
    max-width: 160px;
    height: 100px;
  }
}
