/* =========================================
   ACTU DE VILLE – Webapp
   ========================================= */

:root {
    --blue-main: #1E4F8A;
    --blue-light: #2F6FB5;
    --red-alert: #D0342C;
    --yellow-alert: #E8A128;
    --grey-bg: #F5F7FA;
    --grey-text: #333333;
    --border-soft: #E0E4EC;
    --white: #FFFFFF;
    --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.08);
    --radius-card: 14px;
    --bottom-nav-height: 64px;
    --max-width: 960px;
    --spacing: 16px;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--grey-text);
    background-color: var(--grey-bg);
}

body {
    padding-bottom: var(--bottom-nav-height);
}

/* =========================================
   TOPBAR
   ========================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(90deg, var(--blue-main), var(--blue-light));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.topbar-city {
    font-size: 0.85rem;
    opacity: 0.9;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-name {
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.5);
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
}

/* =========================================
   NAVIGATION BAS
   ========================================= */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 20;
}

.bottom-nav .nav-link {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.bottom-nav .nav-link span {
    font-size: 0.68rem;
}

/* coloration simple basée sur :target */
.screen {
    display: none;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 18px var(--spacing) 80px;
}

/* Écran visible par défaut (home) */
#home {
    display: block;
}

/* Quand un id est ciblé, on masque les autres et on montre celui-là */
:target.screen {
    display: block;
}
:target ~ #home.screen {
    display: none;
}

/* =========================================
   TITRES, CARTES, BOUTONS
   ========================================= */

.section-title {
    margin: 18px 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.card {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 14px 14px 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.7);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.card-header h3 {
    margin: 0;
    font-size: 1rem;
}

.alert-icon {
    font-size: 1.3rem;
}

.card-meta {
    margin: 2px 0 8px;
    font-size: 0.8rem;
    color: #666;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.btn-primary,
.btn-ghost,
.btn-danger-ghost {
    appearance: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--blue-light);
    color: var(--white);
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-ghost {
    background: transparent;
    color: var(--blue-light);
    border: 1px solid rgba(47,111,181,0.35);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--red-alert);
    border: 1px solid rgba(208,52,44,0.4);
}

.btn-full {
    width: 100%;
}

/* ÉTATS D’ALERTE */

.alert-danger {
    border-left: 6px solid var(--red-alert);
}

.alert-warning {
    border-left: 6px solid var(--yellow-alert);
}

.alert-traffic {
    border-left: 6px solid #f97316;
}

.alert-info {
    border-left: 6px solid var(--blue-light);
}

/* =========================================
   BANNIÈRE MÉTÉO
   ========================================= */

.banner-meteo {
    background: linear-gradient(135deg, var(--blue-light), #4FA2D9);
    color: var(--white);
    border-radius: 18px;
    padding: 14px;
    box-shadow: var(--shadow-soft);
    margin-top: 6px;
}

.banner-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.temp {
    font-size: 2.4rem;
    font-weight: 700;
}

.meteo-libelle {
    font-weight: 600;
}

.meteo-details {
    font-size: 0.8rem;
    opacity: 0.9;
}

.banner-button {
    display: inline-flex;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.7);
    font-size: 0.8rem;
    color: var(--white);
    text-decoration: none;
}

/* =========================================
   FILTRES (ÉCRAN ALERTES)
   ========================================= */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.filter {
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    padding: 6px 10px;
    font-size: 0.8rem;
    background: #ffffff;
    cursor: pointer;
}

.filter.active {
    background: var(--blue-main);
    color: var(--white);
    border-color: var(--blue-main);
}

/* =========================================
   CARTE (PLACEHOLDER)
   ========================================= */

.search-bar {
    margin: 10px 0 14px;
}

.search-bar input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    font-size: 0.9rem;
}

.map-placeholder {
    border-radius: 18px;
    background: repeating-linear-gradient(
        45deg,
        #e6ecf5,
        #e6ecf5 10px,
        #dfe6f0 10px,
        #dfe6f0 20px
    );
    padding: 40px 20px;
    text-align: center;
    color: #475569;
    box-shadow: var(--shadow-soft);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    margin-top: 10px;
}

.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-right: 4px;
}

.legend-dot.danger {
    background: var(--red-alert);
}
.legend-dot.warning {
    background: var(--yellow-alert);
}
.legend-dot.traffic {
    background: #f97316;
}

.floating-button {
    position: fixed;
    right: 16px;
    bottom: calc(var(--bottom-nav-height) + 16px);
    background: var(--blue-light);
    color: var(--white);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(0,0,0,0.25);
    font-size: 0.85rem;
}

/* =========================================
   FORMULAIRES
   ========================================= */

form {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.form-field input,
.form-field textarea,
.form-field select {
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    padding: 9px 10px;
    font-size: 0.9rem;
    resize: vertical;
}

.form-field small {
    font-size: 0.75rem;
    color: #6b7280;
}

.form-info {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #4b5563;
}

/* PROFIL */

.preferences {
    margin-top: 8px;
    border-radius: 14px;
    border: 1px dashed var(--border-soft);
    padding: 10px 12px;
}

.preferences legend {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0 4px;
}

.preferences label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

/* =========================================
   RESPONSIVE LARGE ÉCRANS (DESKTOP)
   ========================================= */

@media (min-width: 900px) {

    body {
        background: radial-gradient(circle at top, #dde7f5 0, #f5f7fa 45%, #e5ebf5 100%);
    }

    .bottom-nav {
        max-width: var(--max-width);
        margin: 0 auto;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 999px 999px 0 0;
    }

    .screen {
        padding-bottom: 90px;
    }

    .banner-meteo {
        margin-top: 14px;
    }
}

.install-banner {
    display: none; /* affiché par le JS */
    padding: 12px 16px;
    background: #1E4F8A;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 8px 16px;
    border-radius: 12px;
}

.install-text h2 {
    font-size: 1rem;
    margin: 0 0 4px;
}

.install-text p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

#installAppBtn.btn-primary {
    flex-shrink: 0;
}

/* Bandeau installation PWA */
.install-banner {
  padding: 12px 16px;
  background: #1E4F8A;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 8px 16px;
  border-radius: 12px;
}

.install-text h2 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.install-text p {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Pop-up d’aide iOS/Mac */
.install-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;           /* affiché par le JS */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.install-modal-content {
  background: #ffffff;
  color: #111;
  max-width: 420px;
  width: 90%;
  padding: 20px 18px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  position: relative;
}

.install-modal-content h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.install-modal-content h3 {
  margin: 12px 0 4px;
  font-size: 1rem;
}

.install-modal-content ol {
  padding-left: 18px;
  margin: 4px 0 6px;
}

.install-note {
  margin-top: 8px;
  font-size: 0.85rem;
  opacity: 0.8;
}

.install-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  cursor: pointer;
}

