/* ===== Google Fonts (imported via header) ===== */

/* ===== Décorations de fond (soleil + nuage) ===== */
body::before,
body::after {
  content: '';
  position: fixed;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background-image: url('/images/Sun.png');
  width: 370px;
  height: 370px;
  top: 50px;
  left: -20px;
}

body::after {
  background-image: url('/images/Cloud.png');
  width: 270px;
  height: 260px;
  bottom: -15px;
  right: 15px;
}

/* ===== Reset & base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 600;
  background-color: #4B9DFF;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.08) 18px,
      rgba(255,255,255,0.08) 19px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 18px,
      rgba(255,255,255,0.08) 18px,
      rgba(255,255,255,0.08) 19px
    );
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.container {
  flex: 1;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Assure que header/main/footer passent au-dessus des décorations */
.site-header,
main.container,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
.site-header {
  background-color: #FFF5E0;
  border-bottom: 3px solid #1a1a1a;
  box-shadow: 0 4px 0 #1a1a1a;
  padding: 0.85rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #E8408A;
  text-decoration: none;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #1a1a1a;
  -webkit-text-stroke: 0.5px #1a1a1a;
}

nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

nav a {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1a1a1a;
  text-decoration: none;
  padding: 0.35rem 1rem;
  border: 2.5px solid #1a1a1a;
  border-radius: 50px;
  background: #FFF5E0;
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: all 0.12s ease;
}

nav a:hover {
  background: #F59E0B;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #1a1a1a;
}

/* ===== Footer ===== */
.site-footer {
  background-color: #FFF5E0;
  border-top: 3px solid #1a1a1a;
  box-shadow: 0 -4px 0 #1a1a1a;
  padding: 0.9rem 0;
  text-align: center;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 0.9rem;
  color: #555;
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #1a1a1a;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 3px solid #1a1a1a;
  border-radius: 10px;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  background: #ffffff;
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: all 0.12s ease;
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus {
  border-color: #E8408A;
  box-shadow: 3px 3px 0 #E8408A;
}

/* ===== Boutons ===== */
.btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border: 3px solid #1a1a1a;
  border-radius: 50px;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: all 0.12s ease;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a1a1a;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a1a1a;
}

.btn-primary {
  background-color: #E8408A;
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #D1306F;
}

.btn-secondary {
  background-color: #FFF5E0;
  color: #1a1a1a;
}

.btn-secondary:hover {
  background-color: #F59E0B;
  color: #1a1a1a;
}

.btn-danger {
  background-color: #EF4444;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #DC2626;
}

/* ===== Carte ===== */
.card {
  background-color: #FFF5E0;
  border: 3px solid #1a1a1a;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: 6px 6px 0 #1a1a1a;
}

/* ===== Messages d'erreur ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.alert-error {
  background-color: #FEE2E2;
  color: #DC2626;
  border: 2.5px solid #EF4444;
  box-shadow: 3px 3px 0 #EF4444;
}

/* ===== Pages vote ===== */
.vote-page {
  display: flex;
  justify-content: center;
  padding-top: 2rem;
}

.vote-card {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.vote-title {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.vote-phase-label {
  color: #444;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.vote-submit {
  margin-top: 1.5rem;
}

.btn-vote {
  padding: 0.8rem 2.5rem;
  font-size: 1.1rem;
}

.vote-feedback h1 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.7rem;
  margin-bottom: 0.75rem;
}

.vote-feedback p {
  color: #444;
  margin-bottom: 0.4rem;
  font-size: 1rem;
  line-height: 1.6;
}

.feedback-icon {
  margin-bottom: 1rem;
  display: block;
}

.feedback-smiley {
  width: 100px;
  height: 100px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.feedback-hint {
  font-size: 0.9rem;
  color: #888;
  margin-top: 0.75rem;
}

/* ===== Smileys (vote) ===== */
.smiley-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.smiley-option input[type="radio"] {
  display: none;
}

.smiley-option label {
  cursor: pointer;
  opacity: 0.45;
  filter: grayscale(0.3);
  transition: opacity 0.15s, transform 0.15s, filter 0.15s;
  display: block;
  text-align: center;
  padding: 0.3rem;
  border: 3px solid transparent;
  border-radius: 12px;
}

.smiley-option label img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.smiley-option label:hover {
  opacity: 1;
  filter: none;
  transform: scale(1.15) rotate(-5deg);
}

.smiley-option input[type="radio"]:checked + label {
  opacity: 1;
  filter: none;
  transform: scale(1.2);
  border-color: #1a1a1a;
  background: #F59E0B;
  box-shadow: 3px 3px 0 #1a1a1a;
}

/* ===== Dashboard ===== */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dashboard-header h1 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #FFF5E0;
  text-shadow: 3px 3px 0 #1a1a1a;
  -webkit-text-stroke: 0.5px #1a1a1a;
}

.meetings-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.meeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.12s ease;
}

.meeting-row:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 #1a1a1a;
  background-color: #FFEDBB;
}

.meeting-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meeting-title {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}

.meeting-date {
  font-size: 0.82rem;
  color: #666;
}

.meeting-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.stat-label {
  font-size: 0.72rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.stat-value {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.stat-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: #888;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  border-style: dashed;
  background-color: rgba(255, 245, 224, 0.85);
}

.empty-state p {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 1rem;
}

/* ===== Badges statut ===== */
.meeting-badge,
.meeting-badge-large {
  display: inline-block;
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  border: 2px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
}

.meeting-badge-large {
  font-size: 0.95rem;
  padding: 0.4rem 1.1rem;
}

.badge-phase1 { background-color: #DBEAFE; color: #1E40AF; }
.badge-phase2 { background-color: #EDE9FE; color: #5B21B6; }
.badge-closed { background-color: #D1FAE5; color: #065F46; }

/* ===== Détail réunion ===== */
.meeting-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.back-link {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 600;
  color: #FFF5E0;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.3rem 0.9rem;
  border: 2px solid #FFF5E0;
  border-radius: 50px;
  transition: all 0.12s ease;
}

.back-link:hover {
  background: #FFF5E0;
  color: #1a1a1a;
}

.meeting-detail h1 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #FFF5E0;
  text-shadow: 3px 3px 0 #1a1a1a;
  margin-bottom: 0.3rem;
}

.meeting-created {
  font-size: 0.85rem;
  color: rgba(255,245,224,0.8);
  margin-bottom: 1.5rem;
}

.meeting-layout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
}

.meeting-layout .results-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* QR Code */
.qr-card {
  width: 318px;
  text-align: center;
}

.qr-card h2 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: #444;
}

.qr-img {
  display: block;
  margin: 0 auto 0.75rem;
  border-radius: 10px;
  border: 3px solid #1a1a1a;
}

.vote-url {
  font-size: 0.72rem;
  color: #666;
  word-break: break-all;
  margin-bottom: 0.5rem;
  font-family: monospace;
}

.qr-hint {
  font-size: 0.82rem;
  color: #888;
}

/* Résultats */
.result-card h2 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.05rem;
  color: #444;
  margin-bottom: 1rem;
}

.average-display {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.average-smiley {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}

.average-value {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #E8408A;
}

.average-label {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.2rem;
  color: #aaa;
}

.vote-count {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 0.75rem;
}

.mood-bar {
  height: 12px;
  background-color: #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
  border: 2px solid #1a1a1a;
}

.mood-fill {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #E8408A);
  border-radius: 50px;
  transition: width 0.4s;
}

.no-votes {
  color: #aaa;
  font-size: 0.95rem;
}

.evolution {
  margin-top: 0.75rem;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.evolution-up { color: #16A34A; }
.evolution-down { color: #DC2626; }

/* Action card */
.action-card {
  background-color: #DBEAFE;
}

.action-card p {
  margin-bottom: 1rem;
  color: #1E40AF;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Formulaires manager */
.form-card {
  max-width: 540px;
  margin: 2rem auto;
}

.form-card h1 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* ===== Page login ===== */
.login-card {
  max-width: 440px;
  margin: 3.5rem auto;
}

.login-card h1 {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  color: #E8408A;
  text-shadow: 2px 2px 0 #1a1a1a;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ===== Déconnexion (form dans nav) ===== */
.logout-form {
  display: inline;
}

.logout-form button {
  background: none;
  border: 2.5px solid #1a1a1a;
  border-radius: 50px;
  color: #1a1a1a;
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 1rem;
  box-shadow: 3px 3px 0 #1a1a1a;
  background-color: #FFF5E0;
  transition: all 0.12s ease;
}

.logout-form button:hover {
  background-color: #EF4444;
  color: #ffffff;
  border-color: #1a1a1a;
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #1a1a1a;
}

/* ===== 404 page ===== */
.not-found-card {
  text-align: center;
  margin-top: 4rem;
}

.not-found-card .error-code {
  font-family: 'Fredoka', system-ui, sans-serif;
  font-size: 6rem;
  font-weight: 700;
  color: #FFF5E0;
  text-shadow: 5px 5px 0 #1a1a1a;
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
}

.not-found-card p {
  font-size: 1rem;
  color: #444;
  margin-bottom: 1rem;
}

/* ===== Zone de suppression réunion ===== */
.delete-zone {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 2px dashed rgba(255, 245, 224, 0.4);
  display: flex;
  justify-content: flex-end;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .meeting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .meeting-stats {
    width: 100%;
    justify-content: space-between;
  }

  .meeting-layout {
    grid-template-columns: 1fr;
  }

  .qr-card {
    width: 100%;
  }

  .smiley-group {
    gap: 0.5rem;
  }

  .smiley-option label img {
    width: 52px;
    height: 52px;
  }

  .meeting-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .average-value {
    font-size: 2.2rem;
  }

  .dashboard-header h1 {
    font-size: 1.6rem;
  }

  .meeting-detail h1 {
    font-size: 1.5rem;
  }
}
