/* Composants : boutons, cartes, lignes de souhait, formulaires, mention Naroum */
/* ===== Boutons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px;
  border-radius: var(--r-md); border: 0; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-decoration: none;
  background: var(--action); color: #fff; transition: background-color .15s ease;
}
.btn:hover { background: var(--action-hover); }
.btn:active { background: var(--action-active); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.ghost { background: var(--subtle); color: var(--title); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 2px var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: .95rem; }
.btn.block { width: 100%; }
.page-head .btn { white-space: nowrap; }
.icon-btn { width: 46px; height: 46px; border-radius: var(--r-sm); border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--text); text-decoration: none; font-size: 1.3rem; }
.icon-btn:active { background: var(--subtle); }
.icon-btn svg { width: 26px; height: 26px; }

/* ===== Cartes ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.pad { padding: 18px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.person {
  position: relative; display: block; overflow: hidden; text-decoration: none; color: inherit; border-radius: var(--r-lg);
  background: var(--surface); aspect-ratio: 4/5; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.person img, .person .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person .ph { display: grid; place-items: center; font-family: var(--display); font-size: 2.8rem; font-weight: 800; color: #fff; background: #205493; }
.person .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px; background: rgba(7, 31, 67, .82); color: #fff; }
.person .cap b { display: block; font-family: var(--display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .cap span { font-size: .8rem; font-weight: 600; color: #a9d5f7; }
.person .tag { position: absolute; top: 8px; right: 8px; background: #fff; color: #071f43; border-radius: var(--r-pill); padding: 2px 10px; font-family: var(--display); font-size: .82rem; font-weight: 700; box-shadow: 0 1px 2px rgba(7,31,67,.2); }

.item {
  display: flex; gap: 14px; align-items: center; padding: 12px; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  transition: border-color .15s ease;
}
.item:hover { border-color: var(--accent); }
.item + .item { margin-top: 10px; }
.item .thumb { width: 72px; height: 72px; border-radius: var(--r-md); object-fit: cover; flex: none; background: var(--subtle); display: grid; place-items: center; font-size: 1.9rem; }
.item .body { flex: 1; min-width: 0; }
.item .name { font-family: var(--display); font-weight: 700; font-size: 1.02rem; color: var(--title); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .meta { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.item .meta.gold { color: var(--success); font-weight: 600; }
.item > svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.badge { display: inline-block; font-family: var(--display); font-size: .82rem; font-weight: 700; padding: 3px 12px; border-radius: var(--r-pill); background: var(--secret-bg); color: var(--secret); }
.badge.gold { background: var(--success-bg); color: var(--success); }

.empty { text-align: center; padding: 26px 18px; color: var(--muted); }
.empty .big { font-size: 2.6rem; }

.hint { background: var(--secret-bg); border: 1px solid var(--line); border-left: 0; color: var(--text); border-radius: var(--r-lg); padding: 14px 16px; font-size: .98rem; }

/* ===== Formulaires ===== */
label.f { display: grid; gap: 8px; font-family: var(--display); font-size: .95rem; font-weight: 700; color: var(--title); }
input[type=text], input[type=email], input[type=url], input[type=date], input[type=search], input:not([type]), textarea, select {
  width: 100%; min-height: 52px; padding: 12px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line);
  background: var(--field); color: var(--text); font-family: var(--body); font-size: 17px; outline: none;
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, textarea:focus, select:focus { border-color: var(--action); box-shadow: 0 0 0 3px rgba(47,127,237,.2); outline: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; cursor: pointer; font-weight: 600; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch input { appearance: none; width: 52px; height: 30px; border-radius: var(--r-pill); background: var(--hover); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(7,31,67,.25); transition: transform .15s; }
.switch input:checked { background: var(--action); }
.switch input:checked::after { transform: translateX(22px); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs .t { position: relative; }
.thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); }
.thumbs button { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); background: var(--danger); color: #fff; cursor: pointer; font-weight: 700; }
.addimg { width: 80px; height: 80px; border-radius: var(--r-md); border: 2px dashed var(--line); display: grid; place-items: center; cursor: pointer; color: var(--action); font-size: 1.9rem; background: var(--field); }
.search { position: relative; }
.search input { padding-left: 46px; }
.search svg { position: absolute; left: 14px; top: 14px; width: 24px; height: 24px; color: var(--muted); }

/* « Une application Naroum » */
.by-naroum { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: .85rem; text-decoration: none; font-weight: 400; }
.by-naroum img { height: 26px; width: auto; }
.login .by-naroum { margin-top: 34px; color: #b8c6da; }
.naroum-light { display: block; }
.naroum-dark { display: none; }
@media (prefers-color-scheme: dark) { .naroum-light { display: none; } .naroum-dark { display: block; } }
.login .naroum-light { display: none; }
.login .naroum-dark { display: block; }

/* ===== Lignes de souhait avec actions rapides (comme dans Glide) ===== */
.item { flex-wrap: wrap; }
.item-main { display: flex; gap: 14px; align-items: center; flex: 1; min-width: 0; text-decoration: none; color: inherit; font-weight: inherit; }
.item-main > svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.item .item-menu { width: 40px; height: 40px; flex: none; color: var(--muted); }
.item .item-menu svg { width: 22px; height: 22px; }
.item .quick { flex-basis: 100%; display: flex; gap: 8px; flex-wrap: wrap; padding-left: 86px; }
.chip-btn { border: 1px solid var(--line); background: var(--field); color: var(--title); border-radius: var(--r-pill); padding: 6px 14px; font-family: var(--display); font-weight: 700; font-size: .85rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--action); color: var(--action); }
.chip-btn.primary { background: var(--action); border-color: var(--action); color: #fff; }
.chip-btn.primary:hover { background: var(--action-hover); color: #fff; }
@media (max-width: 420px) { .item .quick { padding-left: 0; } }

/* ===== Filtres par famille ===== */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px 0 0; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--title); border-radius: var(--r-pill); padding: 7px 16px; font-family: var(--display); font-weight: 700; font-size: .88rem; cursor: pointer; }
.chip.on { background: var(--action); border-color: var(--action); color: #fff; }

/* ===== Carte de personne avec menu ===== */
.person-wrap { position: relative; }
.person-wrap .card-menu { position: absolute; top: 8px; left: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: #071f43; display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 2px rgba(7,31,67,.2); }
.person-wrap .card-menu svg { width: 20px; height: 20px; }

/* Logo CadListes affiché à la place d'une image introuvable : jamais rogné */
img.img-fallback { object-fit: contain !important; background: #071f43; }
