/* Essence Alert — UI Simple v1
   Objectif: onboarding ABSURDEMENT simple
   1) Code postal
   2) Sauvegarder stations
   3) SMS quand ça baisse
*/

:root{
  --bg1:#f6f9ff;
  --bg2:#eef3ff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:rgba(11,18,32,.65);
  --border:rgba(11,18,32,.10);
  --shadow: 0 18px 55px rgba(2, 20, 60, .12);

  --brand:#1d4ed8; /* bleu */
  --brand2:#2563eb;
  --brandSoft:rgba(29,78,216,.10);
  --ok:#16a34a;
  --warn:#d97706;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:radial-gradient(1200px 500px at 50% 0%, var(--bg2) 0%, var(--bg1) 55%, #fff 100%);
}

a{color:inherit; text-decoration:none}

.wrap{max-width:980px; margin:0 auto; padding:26px 16px 50px}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}
.dot{width:10px;height:10px;border-radius:50%;background:var(--brand)}

.link{
  font-weight:700;
  color:var(--brand);
}
.link:hover{ text-decoration:underline }

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:22px;
}

.hero{
  display:grid;
  gap:14px;
}

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

.sub{
  color:var(--muted);
  font-size:15px;
}

.steps{
  display:grid;
  gap:8px;
  padding:14px;
  border-radius:14px;
  background:linear-gradient(180deg, rgba(29,78,216,.08), rgba(29,78,216,.03));
  border:1px solid rgba(29,78,216,.18);
}
.steps b{color:var(--text)}
.steps .line{display:flex; gap:10px; align-items:flex-start; font-size:14px; color:var(--muted)}
.steps .n{
  width:22px;height:22px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  background:var(--brandSoft);
  color:var(--brand);
  font-weight:800;
  flex:0 0 auto;
  margin-top:1px;
}

.form{
  display:grid;
  gap:12px;
  margin-top:6px;
}

.row2{display:grid; grid-template-columns:1fr 1fr; gap:10px}

label{display:block; font-size:12px; font-weight:800; color:rgba(11,18,32,.70); letter-spacing:.9px}

.input, select{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
  outline:none;
  font-size:16px;
}
.input:focus, select:focus{border-color:rgba(29,78,216,.45); box-shadow:0 0 0 4px rgba(29,78,216,.12)}

.btn{
  appearance:none;
  border:none;
  cursor:pointer;
  padding:12px 14px;
  border-radius:14px;
  font-weight:800;
  font-size:15px;
}
.btn.primary{
  background:linear-gradient(180deg, var(--brand2), var(--brand));
  color:#fff;
  box-shadow:0 14px 26px rgba(29,78,216,.28);
}
.btn.primary:hover{ filter:brightness(1.02) }

.btn.ghost{
  background:#fff;
  border:1px solid var(--border);
  color:var(--text);
}

.btn.small{padding:10px 12px; border-radius:12px; font-size:14px}

.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--muted);
  font-weight:700;
  font-size:13px;
}

.notice{
  padding:14px;
  border-radius:14px;
  border:1px dashed rgba(29,78,216,.25);
  background:rgba(29,78,216,.04);
  color:rgba(11,18,32,.78);
}

.list{display:grid; gap:12px; margin-top:14px}

.station{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:16px;
  background:#fff;
}
.station h3{margin:0; font-size:16px}
.station .addr{color:var(--muted); font-size:13px; margin-top:3px}
.station .meta{color:var(--muted); font-size:12px; margin-top:8px}

.price{
  display:flex; flex-direction:column; align-items:flex-end; gap:8px;
}
.price .p{
  font-weight:900;
  font-size:18px;
}
.badge{
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid var(--border);
  background:#fff;
  color:rgba(11,18,32,.72);
}
.badge.ok{border-color:rgba(22,163,74,.28); background:rgba(22,163,74,.06)}
.badge.warn{border-color:rgba(217,119,6,.28); background:rgba(217,119,6,.06)}

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

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:#0b1220;
  color:#fff;
  padding:12px 14px;
  border-radius:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
  opacity:0;
  pointer-events:none; /* caché = non cliquable */
  transition:opacity .18s ease, transform .18s ease;
  display:flex;
  gap:12px;
  align-items:center;
  z-index:9999;
}

.toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(-4px);
  pointer-events:auto; /* visible = cliquable */
}

.toast a{
  color:#fff;
  text-decoration:underline;
  font-weight:800;
  pointer-events:auto;
}


@media (max-width:640px){
  .row2{grid-template-columns:1fr}
  h1{font-size:30px}
}

/* ===== Mobile polish (results + general) ===== */

@media (max-width: 768px) {
  .wrap {
    padding: 14px 12px 28px;
  }

  .top {
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
  }

  .top .actions {
    width: 100%;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .top .actions .link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 6px 10px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid var(--border);
    text-decoration: none;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  h1 {
    font-size: 24px;
    line-height: 1.15;
  }

  .sub {
    font-size: 14px;
    line-height: 1.35;
  }

  .pill {
    margin-left: 0 !important;
    margin-top: 8px;
    display: inline-flex;
    width: 100%;
    justify-content: center;
  }

  .hero .actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .hero .actions .btn {
    width: 100%;
  }

  .notice {
    font-size: 14px;
    line-height: 1.35;
    padding: 12px;
  }

  .list {
    gap: 10px;
    margin-top: 12px;
  }

  .station {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 10px;
    border-radius: 14px;
  }

  .station h3 {
    font-size: 15px;
    line-height: 1.2;
  }

  .station .addr {
    font-size: 12px;
    line-height: 1.3;
  }

  .station .meta {
    font-size: 12px;
    line-height: 1.3;
  }

  .price {
    align-items: stretch;
    width: 100%;
    gap: 8px;
  }

  .price .p {
    font-size: 17px;
    text-align: left;
  }

  .price .btn {
    width: 100%;
  }

  .badge {
    font-size: 11px;
    padding: 6px 8px;
  }

  .footer {
    font-size: 12px;
    line-height: 1.35;
    margin-top: 14px;
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    width: auto;
    max-width: none;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.3;
    align-items: flex-start;
    gap: 8px;
  }

  .toast.show {
    transform: translateY(-2px);
    pointer-events: auto;
  }

}

/* Très petits écrans */
@media (max-width: 380px) {
  h1 {
    font-size: 21px;
  }

  .btn {
    font-size: 14px;
    padding: 11px 12px;
  }

  .price .p {
    font-size: 16px;
  }
}
@media (max-width: 768px) {
  .mobile-cta-bar {
    position: sticky;
    bottom: 8px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 20;
  }
}

/* ---------------- Mobile polish (<= 640px) ---------------- */
@media (max-width:640px){
  .wrap{
    padding:14px 10px 28px;
  }

  .top{
    align-items:flex-start;
    gap:8px;
    margin-bottom:12px;
  }

  .brand{
    font-size:14px;
    line-height:1.2;
  }

  .actions{
    gap:8px;
  }

  .link{
    font-size:13px;
  }

  .card{
    padding:14px;
    border-radius:14px;
  }

  h1{
    font-size:24px;
    line-height:1.15;
  }

  .sub{
    font-size:13px;
    line-height:1.35;
  }

  .pill{
    display:inline-flex;
    margin-top:8px;
    margin-left:0 !important; /* écrase le inline style actuel */
    font-size:12px;
    padding:6px 8px;
  }

  .notice{
    padding:10px;
    font-size:13px;
    line-height:1.35;
  }

  .btn{
    width:100%;
    justify-content:center;
    display:inline-flex;
    align-items:center;
  }

  .btn.small{
    width:auto; /* le bouton station garde sa taille */
    min-width:124px;
  }

  .station{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:12px;
    border-radius:14px;
  }

  .station h3{
    font-size:15px;
    line-height:1.2;
  }

  .station .addr{
    font-size:12px;
    line-height:1.35;
    word-break:break-word;
  }

  .station .meta{
    font-size:11px;
    line-height:1.35;
  }

  .price{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }

  .price .p{
    font-size:16px;
    white-space:nowrap;
  }

  .badge{
    font-size:11px;
    padding:5px 8px;
  }

  .toast{
    left:10px;
    right:10px;
    bottom:12px;
    transform:none;
    width:auto;
    max-width:none;
    border-radius:12px;
    padding:10px 12px;
    font-size:13px;
    line-height:1.3;
  }

  .toast.show{
    transform:translateY(-4px);
  }

  /* Le mini "steps" de /favorites devient plus stable */
  .steps{
    padding:10px;
    gap:6px;
  }
  .steps .line{
    display:flex;
    flex-wrap:wrap;
    align-items:flex-start;
    column-gap:8px;
    row-gap:2px;
    line-height:1.3;
    font-size:13px;
  }

  .steps .line .n{
    flex:0 0 22px;
    margin-top:1px;
  }

  .steps .line > *:not(.n){
    min-width:0;
  }

  .steps .line b{
    white-space:normal;
  }

}

/* ===== Footer (global) ===== */
.site-footer{
  margin-top:18px;
  padding:14px 10px 4px;
  border-top:1px solid var(--border);
}

.site-footer__links{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  justify-content:center;
}

.site-footer__links a{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  text-decoration:none;
}

.site-footer__links a:hover{
  color:var(--brand);
  text-decoration:underline;
}

.site-footer__meta{
  margin-top:8px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}

/* ===== Legal pages ===== */
.legal-wrap{
  max-width:860px;
}

.legal-card h1{
  margin-bottom:6px;
}

.legal-card h2{
  margin:18px 0 6px;
  font-size:18px;
}

.legal-card p{
  margin:0;
  color:var(--muted);
  line-height:1.5;
}

@media (max-width:640px){
  .legal-card h2{
    font-size:16px;
  }
  .site-footer{
    margin-top:14px;
    padding-top:12px;
  }
  .site-footer__links{
    gap:8px 10px;
  }
  .site-footer__links a{
    font-size:12px;
  }
}