/* ══════════════════════════════════════════════════════════
   Pref Auto — Design mobile-first
   ══════════════════════════════════════════════════════════ */

:root {
  --primary:    #1a73e8;
  --primary-dk: #1558b0;
  --success:    #34a853;
  --warning:    #fbbc04;
  --error:      #ea4335;
  --neutral:    #5f6368;
  --bg:         #f8f9fa;
  --card-bg:    #ffffff;
  --text:       #202124;
  --text-light: #5f6368;
  --border:     #dadce0;
  --radius:     12px;
  --shadow:     0 1px 4px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: env(safe-area-inset-bottom, 16px);
}

/* ── Header ────────────────────────────────────────────── */
header {
  background: var(--primary);
  color: #fff;
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
header h1 { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
.header-icon { font-size: 22px; }

/* ── Contenu principal ─────────────────────────────────── */
main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-light);
  margin-bottom: 12px;
}

/* ── Guichets ──────────────────────────────────────────── */
.counter-list { display: flex; flex-direction: column; gap: 8px; }

.counter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.counter-name { font-weight: 500; }
.counter-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}

/* États */
.status-slot   { color: var(--success); }
.status-ok     { color: var(--neutral); }
.status-failed { color: var(--warning); }

.counter-item.slot   { border-color: var(--success); background: #e6f4ea; }
.counter-item.failed { border-color: var(--warning);  background: #fef7e0; }

/* ── Countdown ─────────────────────────────────────────── */
.countdown-display {
  text-align: center;
  padding: 10px 0 4px;
}
.countdown-value {
  font-size: 42px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.countdown-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.last-check {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 10px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #e8f0fe;
  color: var(--primary);
  font-weight: 500;
}
.status-badge.paused { background: #fce8e6; color: var(--error); }

/* ── Notifications ─────────────────────────────────────── */
.push-status {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  min-height: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-danger    { background: #fce8e6; color: var(--error); }
.btn:disabled  { opacity: .5; cursor: not-allowed; }

.push-unsupported {
  font-size: 13px;
  color: var(--text-light);
  padding: 10px 0;
  text-align: center;
}

/* ── Install ───────────────────────────────────────────── */
details { margin-top: 10px; }
details + details { margin-top: 6px; }
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::before { content: "▶"; font-size: 10px; color: var(--text-light); transition: transform .2s; }
details[open] summary::before { transform: rotate(90deg); }

.install-steps {
  padding: 12px 14px 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.install-step {
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
}
.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.warning-ios {
  background: #fef7e0;
  border: 1px solid var(--warning);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: #5c3e00;
  margin: 8px 0;
  line-height: 1.4;
}
.warning-ios strong { display: block; margin-bottom: 3px; }

/* ── Skeleton / loading ────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8eaed 25%, #f1f3f4 50%, #e8eaed 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  height: 18px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Responsive fine-tuning ────────────────────────────── */
@media (max-width: 360px) {
  main { padding: 12px 10px; }
  .countdown-value { font-size: 36px; }
}
