* { box-sizing: border-box; }

/* --- Base --- */
body {
  margin:0;
  font-family: system-ui, Arial;
  background:#f6f6f8;
  color:#111;
  line-height: 1.35;
}

/* Petit fond plus doux (sans casser) */
body{
  background:
    radial-gradient(900px 500px at 50% -120px, rgba(184,138,42,.12), transparent 60%),
    #f6f6f8;
}

/* --- Header --- */
.header {
  padding: 22px 14px;
  text-align:center;
  background:
    linear-gradient(
      180deg,
      rgba(184,138,42,0.25) 0%,
      rgba(255,255,255,1) 70%
    );
  border-bottom: 1px solid #e7e7ee;
}

.header{
  position: relative;
}
.header::after{
  content:"";
  position:absolute;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:120px;
  height:2px;
  background: linear-gradient(90deg, transparent, #b88a2a, transparent);
}


.header h1 {
  margin: 0 0 8px;
  font-size: 24px;
  letter-spacing: .2px;
}

.header p {
  margin:0;
  font-size: 16px;
  color:#444;
}

/* Logo */
.logo {
  max-width: 220px;      /* taille max sur desktop */
  width: 100%;
  height: auto;
  margin: 0 auto 14px;
  display: block;
}
@media (max-width: 600px) {
  .logo { max-width: 160px; }
}

/* --- Grid responsive (inchangé) --- */
.grid{
  display:grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
  max-width: 1100px;
  margin: 10px auto 0;
}
@media (min-width: 620px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px){ .grid{ grid-template-columns: repeat(3, 1fr); } }

/* --- Cards --- */
.card{
  background:#fff;
  border-radius:16px;
  overflow:hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  position:relative;
  border: 1px solid rgba(17, 24, 39, 0.06);
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.09);
}

/* Placeholder photo */
.photo{
  width:100%;
  height: 220px;
  object-fit: cover;
  display:block;
  background: linear-gradient(135deg, #f1f1f5 0%, #fbfbfb 100%);
}
.photo-compare{
  display:grid;
  gap:8px;
  padding:10px 10px 0;
}
.layout-side .photo-compare{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.layout-stacked .photo-compare{
  grid-template-columns: 1fr;
}
.photo-slot{
  margin:0;
  position:relative;
}
.photo-label{
  position:absolute;
  left:8px;
  top:8px;
  z-index:1;
  display:flex;
  flex-direction:column;
  gap:1px;
  padding:6px 9px;
  border-radius:10px;
  color:#fff;
  line-height:1.1;
  box-shadow: 0 3px 12px rgba(0,0,0,.2);
}
.photo-label-main{
  font-size:14px;
  font-weight:800;
  letter-spacing:.2px;
}
.photo-label-before{
  background: linear-gradient(180deg, rgba(30,41,59,.9), rgba(15,23,42,.9));
}
.photo-label-after{
  background: linear-gradient(180deg, rgba(184,138,42,.95), rgba(156,116,34,.95));
}
.photo-slot .photo{
  border-radius:12px;
}

/* Badge votes */
.badge{
  position:absolute;
  top:10px;
  right:10px;
  z-index: 5;
  background: rgba(17,17,17,.92);
  color:#fff;
  padding:8px 10px;
  border-radius: 999px;
  font-size:14px;
  font-weight: 700;
  backdrop-filter: blur(6px);
}

/* Contenu card */
.card-body{
  padding: 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.title{
  position: relative;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8f5ed, #fff);
  border: 1px solid rgba(184,138,42,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .2px;
  text-align: center;
}

/* --- Boutons --- */
.btn{
  border:0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 18px;
  cursor:pointer;
  transition: transform .08s ease, filter .12s ease, box-shadow .12s ease;
}

.btn:hover{ filter: brightness(1.03); }
.btn:active{ transform: translateY(1px); }

/* Bouton Je vote : bleu premium + hover */
.vote-btn{
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #b88a2a 0%, #9c7422 100%);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(184,138,42,.25);
}

/* effet lumière */
.vote-btn::before{
  content:"";
  position:absolute;
  top:0;
  left:-120%;
  width:120%;
  height:100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255,255,255,0.45) 50%,
    transparent 100%
  );
}

/* animation au survol */
.vote-btn:hover::before{
  animation: shine 0.9s ease-in-out;
}

.vote-btn:hover{
  box-shadow: 0 10px 22px rgba(184,138,42,.35);
}

/* animation keyframes */
@keyframes shine{
  from { left:-120%; }
  to   { left:120%; }
}

/* Bouton submit : doré (cohérent avec logo) */
.btn.primary{
  background: linear-gradient(180deg, #b88a2a 0%, #9c7422 100%);
  color:#fff;
  box-shadow: 0 8px 16px rgba(184,138,42,.20);
}

.btn.primary:hover{
  box-shadow: 0 10px 20px rgba(184,138,42,.26);
}

/* Focus accessibilité clavier */
.btn:focus-visible,
input:focus-visible{
  outline: 3px solid rgba(184,138,42,.35);
  outline-offset: 2px;
}

/* --- Modal --- */
.modal{
  position:fixed;
  inset:0;
  display:none;
  place-items:center;
  background: rgba(0,0,0,.55);
  padding: 14px;
  z-index: 2000;
}

.modal.open{ display:grid; }

.modal-content{
  width: min(520px, 100%);
  background:#fff;
  border-radius: 18px;
  padding: 16px;
  position:relative;
  border: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.modal-close{
  position:absolute;
  top:10px;
  right:12px;
  width:44px;
  height:44px;
  border-radius: 12px;
  border:0;
  background:#f1f1f5;
  font-size: 26px;
  cursor:pointer;
  transition: filter .12s ease;
}
.modal-close:hover{ filter: brightness(0.97); }

/* --- Form --- */
label{
  display:block;
  font-size: 16px;
  margin-top: 10px;
}

input{
  width:100%;
  padding: 14px 12px;
  font-size: 18px;
  border-radius: 12px;
  border:1px solid #d9d9e5;
  margin-top: 6px;
  background:#fff;
}

/* RGPD */
.rgpd{
  font-size: 14px;
  color:#333;
  margin-top: 12px;
  margin-bottom: 6px;
}
.rgpd input{
  width:auto;
  transform: scale(1.2);
  margin-right: 8px;
}

/* Espace au dessus du bouton Valider */
#voteForm button[type="submit"]{
  margin-top: 20px;
}

/* Textes */
.small{
  font-size: 12px;
  color:#666;
  margin-top: 10px;
}
.toast{
  margin-top: 10px;
  font-size: 16px;
  font-weight:600;
}

/* --- Footer --- */
.footer{
  margin-top: 26px;
  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,1) 0%,
      rgba(184,138,42,0.18) 100%
    );
  border-top: 1px solid #e7e7ee;
  padding: 18px 14px;
}

.footer{
  position: relative;
}

.footer::before{
  content:"";
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:120px;
  height:2px;
  background: linear-gradient(90deg, transparent, #b88a2a, transparent);
}

.footer-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  color: #444;
}

.footer a{
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.footer a:hover{
  text-decoration: underline;
}

@media (max-width: 600px){
  .footer-inner{
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
}
.modal-title{
  margin: 0 0 10px;
  line-height: 1.2;
}

/* "Voter pour :" plus petit */
.modal-title-label{
  display:block;
  font-size: 15px;
  font-weight: 600;
  color: #6b7280;
}

/* Nom à la ligne, plus grand */
.modal-title-name{
  display:block;
  font-size: 24px;
  font-weight: 800;
  color: #111;
  margin-top: 2px;
}
.vote-lock{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background:
    linear-gradient(
      180deg,
      rgba(184,138,42,0.55),
      rgba(255,255,255,0.98)
    );
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}


.vote-lock-inner{
  background:#fff;
  border-radius: 18px;
  padding: 22px 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
  border: 1px solid rgba(184,138,42,.35);
}

.vote-lock-inner h2{
  margin: 0 0 8px;
  font-size: 24px;
}

.vote-lock-date{
  font-size: 16px;
  color:#333;
  margin-bottom: 12px;
}

.vote-lock-timer{
  font-size: 20px;
  font-weight: 900;
  color:#b88a2a;
}

.photo-click{ cursor: zoom-in; }

.photo-pop-content{
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-pop-img{
  max-width: 100%;
  max-height: 80vh;   /* clé du problème */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}
@media (max-height: 600px){
  .photo-pop-img{
    max-height: 70vh;
  }
}
@media (max-width: 460px){
  .layout-side .photo-compare{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:6px;
  }
  .photo{
    height: 180px;
  }
}
