/* === AMO45 Modern Blue Theme === */

/* Couleurs globales */
:root {
  --bg: #f6f9fc;
  --card-bg: #ffffff;
  --brand: #0077ff;
  --brand-dark: #0058c4;
  --brand-light: #e0edff;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 64, 128, 0.08);
  --header-h: 60px;
}

/* Reset & base */
* { box-sizing: border-box; }
html, body {
  
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  line-height: 1.6;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: url("../../img/photo.jpg") no-repeat center center fixed;
  background-size: cover;
  position: relative;
  color: var(--text);
  line-height: 1.5;
}
body {
  /* déjà présent chez toi : margin, font, background, etc. */
  flex-direction: column;
  min-height: 100vh;
}
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
}



.site-footer {
  color: blue; /* texte bien contrasté */
  padding: 1.1rem;
  font-size: 0.9rem;

}

/* Footer collé en bas, garde tes styles et ajoute juste ceci */
.site-footer { margin-top: auto; }

/* Superposition sombre transparente */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45); /* 0.45 = luminosité réduite de ~45% */
  z-index: -1;
}



.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
 background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}

.logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #fff;
  color: var(--brand-dark);
  border-radius: 10px;
  font-weight: bold;
}

/* Navigation */
.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: background .2s ease, color .2s ease;
  font-weight: 500;
}

.btn-nav:hover,
.btn-nav.active {
  background: rgba(255, 255, 255, 0.2);
}

.btn-nav.btn-ghost {
  border: 1px solid rgba(255,255,255,.4);
}

/* Burger menu */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
}

/* Cards */
.card {
	  background: rgba(255, 255, 255, 0.85); /* transparent blanc 
	background: rgba(0, 0, 0, 0.5); /* très léger 
background: rgba(255, 255, 255, 0.85); /* blanc légèrement opaque 
    background: rgba(33, 88, 237, 0.85);
/*	background: transparent !important;
  background: var(--card-bg);*/
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-top: 1rem;
}

.card__title {
  margin: 0 0 .5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.card__subtitle {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* Buttons */
.btn {
  
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  width:auto;
  padding:.8rem 1.2rem;
  border:none;
  border-radius:var(--radius);
  font-weight:600;
  color:#fff;
  background:var(--brand);
  cursor:pointer;
  transition:.2s;
  text-decoration: none;
/*  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--brand);
  color: #fff;

  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
  */
}

.btn:hover {
  background: var(--brand-dark);
}

.btn:active {
  transform: scale(0.97);
}

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

.btn--block {
  width: 100%;
}

/* Formulaires */
.field {
  margin-bottom: 1rem;
}

.label {
  display: block;
  margin-bottom: .3rem;
  font-weight: 600;
}

.input {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 1rem;
}

.input:focus {
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px var(--brand-light);
}

/* Alertes */
.alert {
  padding: .9rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 600;
}

.alert--error {
  background: #fee2e2;
  color: #991b1b;
}

/* Footer */
footer {
  margin-top: 2rem;
  padding: 1rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* Responsive nav */
@media (max-width: 820px) {
  .menu-toggle {
    display: inline-block;
  }

  .nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    background: var(--brand-dark);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    text-align: center;
    z-index: 999;
  }

  .nav.open {
    transform: translateY(0);
  }

  .nav ul {
    flex-direction: column;
    gap: 10px;
    padding: 1rem 0;
  }

  .btn-nav {
    justify-content: center;
    font-size: 1.1rem;
    padding: 10px 20px;
  }
}

/* Petites améliorations visuelles */
main.container {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

ul { padding-left: 1.2rem; }
p { margin: 0.5rem 0 1rem; }
h1, h2, h3 { color: var(--brand-dark); font-weight: 700; }


/* === PWA safe areas (iOS) === */
@supports (padding: max(0px)) {
  .site-header .container {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  body.standalone main.container {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
}

/* Mode standalone (quand l’app est installée) */
@media all and (display-mode: standalone) {
  body { background: #f6f9fc; }
  body::before{ content:""; } /* hook si besoin */
}

/* --- Validation form (login) --- */
.error-text {
  display: block;
  font-size: 0.85rem;
  color: #dc2626; /* rouge */
  margin-top: 4px;
  min-height: 1em;
}

.input:invalid {
  border-color: #f87171;
}

.input:valid {
  border-color: #22c55e;
}


/* === Validation dynamique du formulaire (login) === */
.form-msg {
  font-size: 0.85rem;
  margin-top: 4px;
  min-height: 1em;
  transition: color 0.2s ease;
}

.form-msg.err {
  color: #dc2626; /* rouge */
}

.form-msg.ok {
  color: #16a34a; /* vert */
}

.input {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.input.invalid {
  border-color: #ef4444;
  background-color: #fff5f5;
}

.input.valid {
  border-color: #22c55e;
  background-color: #f0fdf4;
}

/* ===== Mes souscriptions ===== */
.subs-grid {
  display: grid;
  grid-template-columns: repeat( auto-fill, minmax(280px, 1fr) );
  gap: 14px;
  margin-top: 14px;
}

.sub-card { padding: 1rem 1.1rem; }

.sub-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .6rem;
}

.sub-id { font-weight: 700; color: var(--brand-dark); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .85rem; font-weight: 700; letter-spacing: .2px;
  padding: .25rem .5rem; border-radius: 999px;
  border: 1px solid transparent;
}
.badge--ok {
  color: #166534; background: #ecfdf5; border-color: #86efac;
}
.badge--muted {
  color: #334155; background: #e2e8f0; border-color: #cbd5e1;
}

.sub-row {
  display: grid; grid-template-columns: 120px 1fr; gap: 10px;
  padding: .35rem 0; border-bottom: 1px dashed var(--border);
}
.sub-row:last-of-type { border-bottom: none; }

.sub-label { color: var(--muted); font-weight: 600; }
.sub-value { font-weight: 600; color: var(--text); }

.sub-actions {
  display: flex; gap: .5rem; justify-content: flex-end;
  margin-top: .75rem;
}

@media (max-width: 480px){
  .sub-row { grid-template-columns: 1fr; }
  .sub-label { font-size: .9rem; }
}

/* Bouton en chargement */
.btn.is-loading { position: relative; pointer-events:none; opacity:.85; }
.btn .spinner {
  display:inline-block; width:1em; height:1em; margin-right:.5em;
  border:2px solid currentColor; border-right-color: transparent; border-radius:50%;
  vertical-align:-.2em; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}


/* Le contenu principal occupe l’espace restant */
main {
  flex: 1;
}


.navbar {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.navbar-logo {
    max-height: 40px;
    height: auto;
}
.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.68rem;
  color: white;
  font-weight: normal;
}

.site-header {
  background: #2158ED;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 50;

  /* espace sous la barre haute du téléphone si besoin (iOS encoche) */
  padding-top: constant(safe-area-inset-top); /* ancien iOS */
  padding-top: env(safe-area-inset-top);      /* iOS récent */
}

@media (max-width: 768px) {
  .navbar {
    padding: 0.4rem 0.8rem;
  }
}
.btn--loading {
  position: relative;
  cursor: default !important;
  opacity: 0.8;
}

.btn--loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  margin-left: -9px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-right-color: #fff;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

button[disabled],
.btn[disabled] {
  opacity: .6;
  pointer-events: none;
  cursor: default;
}