:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1b1f2a;
  --muted: #5d657a;
  --line: rgba(30, 41, 59, 0.12);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 6px 16px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --accent: #007aff; /* iOS blue */
}

/* Reset / base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 247, 251, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 12px;
}

.brand {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  font-size: 22px;
}

h1 {
  font-size: 20px;
  margin: 0;
  line-height: 1.1;
}

.subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Language switch */
.lang-switch {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.lang-switch button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.lang-switch button.active {
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.12);
}

/* SEARCH */
.search-wrap {
  max-width: 820px;
  margin: 10px auto 10px;
}

#search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  font-size: 15px;
}

#search:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.35);
  box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12),
    var(--shadow-soft);
}

/* FILTERS */
.filters {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}

.chip.is-active {
  color: var(--text);
  border-color: rgba(0, 122, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1),
    var(--shadow-soft);
}

/* MAIN */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 16px 28px;
}

/* META */
.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

/* GRID */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* CARDS */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.problem-card {
  cursor: pointer;
  transition: transform 0.08s ease,
    box-shadow 0.08s ease;
}

.problem-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

.problem-title {
  font-size: 15px;
  margin: 0 0 8px;
  line-height: 1.3;
}

.problem-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(0, 122, 255, 0.1);
  color: rgba(0, 122, 255, 0.95);
  border: 1px solid rgba(0, 122, 255, 0.18);
}

.small {
  font-size: 12px;
  color: var(--muted);
}

/* FOOTER */
.footer {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* DETAIL VIEW */
.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin: 6px 0 10px;
}

.detail-card {
  padding: 16px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.detail-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.badges {
  display: flex;
  gap: 10px;
}

.fav-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

/* SECTIONS */
.section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.paragraph {
  margin: 0;
  line-height: 1.5;
}

.paragraph.strong {
  font-weight: 700;
}

.bullets {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

.bullets li {
  margin-bottom: 4px;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.35);
  backdrop-filter: blur(6px);
  z-index: 50;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 560px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  z-index: 60;
  overflow: hidden;
}

.modal-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  background: rgba(246, 247, 251, 0.7);
}

.modal-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.modal-title {
  margin: 6px 0 0;
  font-size: 16px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-size: 16px;
  box-shadow: var(--shadow-soft);
}

.modal-content {
  padding: 14px 16px 8px;
}

.modal-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.modal-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.modal-text {
  font-size: 14px;
  line-height: 1.5;
}

.modal-actions {
  padding: 10px 16px 14px;
  border-top: 1px solid var(--line);
  background: rgba(246, 247, 251, 0.7);
  display: flex;
  justify-content: flex-end;
}

.modal-ok {
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
}

.modal-ok:hover {
  filter: brightness(0.95);
}

.modal-actions{
  gap: 10px;
}

.modal-secondary{
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.modal-secondary:hover{
  filter: brightness(0.98);
}

/* --- IF NOT MOVING (Et si ça ne bouge pas ?) --- */
.ifnm {
  margin-top: 6px;
}

.ifnm h4 {
  margin: 10px 0 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ifnm ul {
  margin: 0 0 8px;
  padding-left: 18px;
  line-height: 1.55;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.pill:hover {
  filter: brightness(0.98);
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}
