/* ——————————————————————————————————
   App V2 — styles spécifiques à app.html
   Dépend des variables définies dans styles.css
—————————————————————————————————— */

/* Nav link */
.nav a.logo {
  text-decoration: none;
}

/* Nav auth */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  position: relative;
}

.btn-login {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

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

.nav-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-logout {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.btn-logout:hover { color: var(--navy); }

/* Auth dropdown */
.auth-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  padding: 1.1rem;
  z-index: 200;
  animation: fadeUp 0.15s ease both;
}

.auth-dropdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.85rem;
  font-family: var(--font-head);
}

.auth-input {
  display: block;
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--navy);
  background: var(--white);
  outline: none;
  margin-bottom: 0.6rem;
  box-sizing: border-box;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}

.auth-input:focus { border-color: var(--blue); }

.auth-error {
  font-size: 0.78rem;
  color: #DC2626;
  margin-bottom: 0.6rem;
}

.auth-dropdown .btn-primary {
  width: 100%;
  text-align: center;
  padding: 0.7rem;
  font-size: 0.875rem;
  margin-top: 0;
}

.auth-toggle {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.78rem;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  margin-top: 0.75rem;
  padding: 0;
}

.auth-toggle:hover { text-decoration: underline; }

/* Auth panel (sous la nav) */
.auth-panel {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem;
}

.auth-panel-inner {
  max-width: 360px;
  margin: 0 auto;
}

.auth-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  font-family: var(--font-head);
}

.auth-input {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--white);
  outline: none;
  margin-bottom: 0.75rem;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.auth-input:focus { border-color: var(--blue); }

.auth-error {
  font-size: 0.82rem;
  color: #DC2626;
  margin-bottom: 0.75rem;
}

.auth-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
}

.auth-toggle {
  font-size: 0.8rem;
  color: var(--blue);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 0;
}

.auth-toggle:hover { text-decoration: underline; }


/* Avertissement daily */
.daily-warning {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--blue-xlight);
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--blue-light);
  line-height: 1.4;
}

/* Layout principal */
.app-main {
  min-height: calc(100dvh - 60px - 72px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.25rem 4rem;
  background: var(--bg);
}

.app-container {
  width: 100%;
  max-width: 480px;
}

/* Header */
.app-header {
  margin-bottom: 2rem;
}

.app-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--navy);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.app-header p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Champs du formulaire */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}

.field input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--navy);
  background: var(--white);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

/* Supprime les flèches sur les inputs number */
.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.field input[type="number"] { -moz-appearance: textfield; }

.field input::placeholder { color: #94A3B8; }

.field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-xlight);
}

/* Hint sous un champ */
.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Rangée adresse + bouton géoloc */
.address-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.address-row input {
  flex: 1;
  min-width: 0;
}

.btn-geo {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-geo:hover  { background: var(--blue-xlight); border-color: var(--blue); }
.btn-geo:active { transform: scale(0.95); }

.btn-geo:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-geo--loading svg {
  animation: spin 1s linear infinite;
}

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

/* Autocomplétion */
.field--autocomplete {
  position: relative;
}

.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--blue);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  list-style: none;
  z-index: 100;
  overflow: hidden;
}

.suggestions li {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  transition: background 0.12s;
}

.suggestions li:last-child {
  border-bottom: none;
}

.suggestions li:hover {
  background: var(--blue-xlight);
  color: var(--navy);
}

/* Erreur formulaire */
.field-error {
  font-size: 0.875rem;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

/* Bouton pleine largeur */
.btn-full {
  width: 100%;
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ——— Carte résultat ——— */
.result-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.75rem;
  animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Badge info */
.result-badge {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-xlight);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.result-badge--bonus {
  color: #16A34A;
  background: #F0FDF4;
}

/* Stats */
.result-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.result-stat {
  flex: 1;
  text-align: center;
}

.result-value {
  display: block;
  font-family: var(--font-head);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.result-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.result-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
  flex-shrink: 0;
}

/* Bouton Google Maps */
.btn-maps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: background 0.18s, transform 0.1s;
  margin-bottom: 0.85rem;
  -webkit-tap-highlight-color: transparent;
}

.btn-maps:hover  { background: var(--blue-dark); }
.btn-maps:active { transform: scale(0.97); }

/* Bouton reset */
.btn-reset {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.btn-reset:hover { color: var(--navy); }

/* ——— Option verdure ——— */
.green-option {
  margin-bottom: 1.25rem;
}

.green-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.green-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #4A7C59;
  cursor: pointer;
  flex-shrink: 0;
}

.green-checkbox-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
}

.green-checkbox-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
  margin-left: 1.65rem;
  line-height: 1.4;
}

/* Dans les session-cards (mode multi) */
.session-green-option {
  margin-top: 0.5rem;
  min-height: 36px;
}

/* Message de fallback quand aucun espace vert n'est trouvé */
.green-fallback {
  font-size: 0.875rem;
  color: #3D6B35;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Encart "Au passage : [nom du POI]" quand un espace vert est intégré au parcours */
.green-poi-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #4A7C59;
  background: #E8F0E9;
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

/* ——— Liste POI dans result ——— */
.pois-list {
  margin: 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pois-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.pois-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pois-list li {
  font-size: 0.875rem;
  color: var(--text);
  padding: 0.4rem 0.65rem;
  background: var(--bg);
  border-radius: 6px;
  line-height: 1.4;
}

/* ——— Gate multi-sessions ——— */
.multi-gate {
  background: var(--blue-xlight);
  border: 1.5px solid var(--blue-light);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.multi-gate p {
  font-size: 0.875rem;
  color: var(--navy);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.btn-gate-login {
  width: auto;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  margin-top: 0;
}

/* ——— Sélecteur de mode ——— */
.mode-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mode-option {
  display: block;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.mode-option--active {
  border-color: var(--blue);
  background: var(--blue-xlight);
}

.mode-option:hover:not(.mode-option--active) {
  background: var(--bg);
}

.mode-option-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.mode-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.mode-option-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
}

.mode-option--active .mode-option-title {
  color: var(--blue);
}

.mode-option-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ——— Session builder ——— */
.session-builder-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.session-builder-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.15rem;
}

.session-builder-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.session-total {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  flex-shrink: 0;
}

.session-total--ok { color: #16A34A; }
.session-total--over { color: #DC2626; }

/* Session card */
.session-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.session-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.btn-delete-session {
  background: none;
  border: none;
  cursor: pointer;
  color: #DC2626;
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.session-field {
  margin-bottom: 0.65rem;
}

.session-field:last-child {
  margin-bottom: 0;
}

.session-field > label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3rem;
}

.session-field input[type="number"],
.session-field input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--navy);
  background: var(--white);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s;
}

.session-field input:focus {
  border-color: var(--blue);
}

.session-field input[type="number"]::-webkit-inner-spin-button,
.session-field input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.session-time-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.session-time-row input {
  flex: 1;
  width: auto;
}

.session-time-sep {
  font-size: 0.9rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Ajouter une session */
.btn-add-session {
  width: 100%;
  padding: 0.7rem;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: none;
  color: var(--blue);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn-add-session:hover {
  background: var(--blue-xlight);
  border-color: var(--blue);
}

/* Note sous le bouton générer */
.generate-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ——— Résultats multi-sessions ——— */
.result-session-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  animation: fadeUp 0.4s ease both;
}

.result-session-header {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.85rem;
}

.result-session-header time {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* ——— Historique du jour ——— */
.history-section {
  background: var(--bg);
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--border);
}

.history-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 480px;
  margin: 0 auto;
}

.history-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.history-card-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.2rem;
}

.history-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.history-card-link {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.history-card-link:hover {
  color: var(--blue-dark);
}
