/* ═══════════════════════════════════════════════════════════════════════
   forms.css — Formulaire complet, champ Date+Heure, accordéon options, checkbox, thèmes récent
   ─────────────────────────────────────────────────────────
   Extrait de astro_app_V3.8.9.html lignes 803-1204 (Phase 2 du refactoring).
   Cascade : ce fichier doit être chargé dans l'ordre indiqué dans index.html.
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   FORMULAIRE
══════════════════════════════════════════════════════════════════════════ */
.form-panel {
  background: var(--ivoire-clair);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 4px;
  padding: 2rem;
  box-shadow: var(--shadow-soft);

  /* V3.9.1 — Suppression de position:sticky + max-height + overflow.
     ─────────────────────────────────────────────────
     Avant : le panneau était sticky + max-height: calc(100vh - 4rem) +
     overflow-y: auto, ce qui faisait apparaître une scrollbar sur tout
     le formulaire dès qu'il dépassait la hauteur de l'écran.
     Maintenant : le panneau prend sa hauteur naturelle, scrolle avec la
     page. Les blocs internes (ex. .hp-themes-list dans Heures planétaires)
     conservent leur propre scrollbar locale via leurs règles dédiées. */
}

.form-panel h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.form-panel .form-intro {
  font-size: 0.85rem;
  color: var(--encre-clair);
  margin-bottom: 1.8rem;
  font-style: italic;
  font-family: var(--serif);
  font-size: 0.95rem;
}

.field-group {
  margin-bottom: 1.5rem;
}

.field-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-clair);
  margin-bottom: 0.4rem;
}

.field-group input,
.field-group select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--encre);
  background: var(--ivoire);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 3px;
  transition: border-color 0.2s;
}

.field-group input:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--terracotta);
  background: #fff;
}

.field-group input[type="number"] { font-family: var(--mono); }

/* Champs lat/lon en deux colonnes */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.field-row .field-group { margin-bottom: 0; }

/* Aide contextuelle */
.field-help {
  font-size: 0.75rem;
  color: var(--encre-clair);
  margin-top: 0.3rem;
  font-family: var(--serif);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════
   UX v3.0 — Champ Date + Heure côte à côte (date plus large)
══════════════════════════════════════════════════════════════════════════ */
.field-row-date-heure {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.7rem;
}

.field-row-date-heure .field-date input,
.field-row-date-heure .field-heure input {
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════════
   UX v3.0 — Accordéon Options avancées
══════════════════════════════════════════════════════════════════════════ */
.options-accordion {
  margin: 0.8rem 0 1.2rem;
  border-top: 1px dashed var(--ivoire-fonce);
  padding-top: 0.8rem;
}

.options-accordion summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--encre-clair);
  padding: 0.4rem 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  user-select: none;
  transition: color 0.15s ease;
}

.options-accordion summary::-webkit-details-marker { display: none; }

.options-accordion summary::before {
  content: '▸';
  font-size: 0.8rem;
  color: var(--terracotta);
  transition: transform 0.2s ease;
  display: inline-block;
}

.options-accordion[open] summary::before {
  transform: rotate(90deg);
}

.options-accordion summary:hover {
  color: var(--terracotta);
}

.options-accordion .options-content {
  margin-top: 0.6rem;
  padding: 0.5rem 0;
  animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.options-accordion .options-intro {
  font-size: 0.78rem;
  color: var(--encre-clair);
  font-style: italic;
  font-family: var(--serif);
  margin: 0 0 0.8rem 0;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════════════════
   UX v3.0 — Labels checkbox uniformisés
══════════════════════════════════════════════════════════════════════════ */
.checkbox-label {
  font-weight: normal;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--encre);
  margin-top: 0.3rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   UX v3.0 — Bloc Thèmes récents (localStorage)
══════════════════════════════════════════════════════════════════════════ */
.themes-recents {
  background: rgba(160, 134, 84, 0.06);
  border-left: 3px solid var(--or-mat);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1.2rem;
  border-radius: 2px;
}

.themes-recents-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--or-mat);
  margin-bottom: 0.5rem;
  display: block;
}

.themes-recents-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.theme-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--ivoire);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 14px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--encre);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-recent-chip:hover {
  background: rgba(184, 85, 63, 0.08);
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.theme-recent-chip .theme-recent-date {
  font-size: 0.7rem;
  color: var(--encre-clair);
}

.theme-recent-chip:hover .theme-recent-date {
  color: var(--terracotta);
  opacity: 0.7;
}

.theme-recent-chip .theme-recent-delete {
  font-size: 0.85rem;
  opacity: 0.4;
  margin-left: 0.2rem;
  transition: opacity 0.15s ease;
}

.theme-recent-chip:hover .theme-recent-delete {
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════════════════
   AUTOCOMPLETE VILLES (v2.9) — Liste déroulante de suggestions
══════════════════════════════════════════════════════════════════════════ */
.autocomplete-wrapper {
  position: relative;
}

.city-suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ivoire);
  border: 1.5px solid var(--encre-clair);
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(26, 34, 56, 0.12);
  display: none;
}

.city-suggestions.active {
  display: block;
}

.city-suggestions li {
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--encre);
  border-bottom: 1px solid rgba(26, 34, 56, 0.06);
  transition: background 0.12s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

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

.city-suggestions li:hover,
.city-suggestions li.selected {
  background: rgba(184, 85, 63, 0.1);
  color: var(--terracotta);
}

.city-suggestions li .city-coords {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--encre-clair);
  font-weight: 400;
}

.city-suggestions li:hover .city-coords,
.city-suggestions li.selected .city-coords {
  color: var(--terracotta);
  opacity: 0.7;
}

/* Highlight de la portion correspondant à la saisie */
.city-suggestions li mark {
  background: rgba(160, 134, 84, 0.25);
  color: inherit;
  font-weight: 600;
  padding: 0;
  border-radius: 1px;
}

/* Pas de résultat */
.city-suggestions .no-results {
  padding: 0.7rem 0.9rem;
  font-style: italic;
  color: var(--encre-clair);
  font-size: 0.85rem;
  text-align: center;
  cursor: default;
}

.city-suggestions .no-results:hover {
  background: transparent;
  color: var(--encre-clair);
}

/* ═══════════════════════════════════════════════════════════════════════
   ZONE D'INFORMATION DST (v2.7) — Détection automatique du décalage UTC
══════════════════════════════════════════════════════════════════════════ */
.dst-info {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 1rem;
  margin-top: 0.5rem;
  border-radius: 3px;
  background: rgba(160, 134, 84, 0.08);
  border-left: 3px solid var(--or-mat);
  transition: all 0.3s ease;
}

.dst-info.dst-ok {
  background: rgba(94, 114, 100, 0.08);
  border-left-color: var(--vert-sauge);
}

.dst-info.dst-warning {
  background: rgba(184, 85, 63, 0.06);
  border-left-color: var(--terracotta);
}

.dst-info .dst-icon {
  font-size: 1.1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.dst-info .dst-text {
  flex: 1;
}

.dst-info .dst-text strong {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--encre);
  margin-bottom: 0.2rem;
  letter-spacing: 0.02em;
}

.dst-info .dst-detail {
  font-family: var(--serif);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--encre-clair);
  line-height: 1.5;
}

/* Quand la valeur manuelle est forcée, le bloc DST devient gris */
.dst-info.dst-disabled {
  opacity: 0.45;
  background: rgba(0, 0, 0, 0.03);
  border-left-color: #ccc;
}

/* ═══════════════════════════════════════════════════════════════════════
   V3.9.1 — Case à cocher "Heure de naissance inconnue" + bloc d'aide
   ─────────────────────────────────────────────────────
   Préfixe : .hi-* (Heure Inconnue)
═══════════════════════════════════════════════════════════════════════ */
.field-heure-inconnue {
  margin-top: -0.5rem;       /* rapprochement visuel du bloc date+heure ci-dessus */
  margin-bottom: 1.2rem;
}

.hi-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--encre-clair);
  cursor: pointer;
  user-select: none;
  padding: 0.4rem 0;
  transition: color 0.15s ease;
}
.hi-checkbox-label:hover {
  color: var(--encre);
}
.hi-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--terracotta);   /* coche en cyan/accent (palette charte) */
}

/* ─── Bloc d'aide (s'affiche quand la case est cochée) ──────────────── */
.hi-help {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.6rem;
  padding: 0.85rem 1rem;
  background: rgba(83, 158, 218, 0.08);
  border-left: 3px solid var(--terracotta);
  border-radius: 3px;
  /* Animation d'apparition douce */
  animation: hi-help-fade-in 0.25s ease-out;
}
@keyframes hi-help-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hi-help-icon {
  flex-shrink: 0;
  font-size: 1.3rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.hi-help-body { flex: 1; }

.hi-help-title {
  margin: 0 0 0.4rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--encre);
}

.hi-help-text {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--encre);
}
.hi-help-text strong {
  color: var(--terracotta-fonce);
  font-weight: 600;
}

.hi-help-warning {
  margin: 0;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(83, 158, 218, 0.3);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--encre-clair);
}

/* ─── État grisé du champ heure quand la case est cochée ──────────── */
.field-heure.is-disabled label,
.field-heure.is-disabled input {
  opacity: 0.45;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   V3.9.1 — Rendu du thème natal SANS heure (S1 #2)
   ─────────────────────────────────────────────────
   Disclaimer banner + tables simplifiées + invitation à revenir.
═══════════════════════════════════════════════════════════════════════ */

/* ─── Banner d'avertissement en tête de la vue ──────────────────────── */
.banner-heure-inconnue {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.3rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(160, 134, 84, 0.08), rgba(160, 134, 84, 0.04));
  border: 1px solid rgba(160, 134, 84, 0.35);
  border-left: 4px solid var(--or-mat);
  border-radius: 4px;
}
.banner-hi-icon {
  flex-shrink: 0;
  font-size: 1.5rem;
  line-height: 1;
  margin-top: 0.15rem;
}
.banner-hi-body { flex: 1; }
.banner-hi-title {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--encre);
}
.banner-hi-text {
  margin: 0 0 0.7rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--encre);
}
.banner-hi-text strong { color: var(--terracotta-fonce); }
.banner-hi-hint {
  margin: 0;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(160, 134, 84, 0.3);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--encre-clair);
}
.banner-hi-hint strong { color: var(--encre); }

/* ─── En-tête du thème simplifié ────────────────────────────────────── */
.theme-header-sans-heure .signature-sans-heure {
  font-style: italic;
  font-size: 0.85rem;
  color: var(--encre-clair);
}

/* ─── Tables simplifiées ────────────────────────────────────────────── */
.bloc-planetes-signes,
.bloc-aspects-simplifies {
  margin: 1.8rem 0;
}
.bloc-planetes-signes .bloc-titre,
.bloc-aspects-simplifies .bloc-titre {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.55rem;
  color: var(--encre);
}
.bloc-planetes-signes .bloc-intro,
.bloc-aspects-simplifies .bloc-intro {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--encre-clair);
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-style: italic;
}

.table-planetes-sans-heure,
.table-aspects-sans-heure {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.table-planetes-sans-heure th,
.table-aspects-sans-heure th {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 2px solid var(--ivoire-fonce);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-clair);
}
.table-planetes-sans-heure td,
.table-aspects-sans-heure td {
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid rgba(187, 194, 201, 0.4);
}
.table-planetes-sans-heure tbody tr:last-child td,
.table-aspects-sans-heure tbody tr:last-child td {
  border-bottom: 0;
}

.table-planetes-sans-heure .symbole-planete,
.table-aspects-sans-heure .symbole-aspect {
  display: inline-block;
  margin-right: 0.25rem;
  font-size: 1rem;
  color: var(--terracotta);
}

.retro-tag {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0 0.3rem;
  background: rgba(139, 58, 58, 0.15);
  color: var(--rouge-brique);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 2px;
}

/* ─── Bloc final invitant à revenir avec l'heure ────────────────────── */
.bloc-revenir-heure {
  margin: 2rem 0 1rem;
  padding: 1.1rem 1.3rem;
  background: rgba(83, 158, 218, 0.06);
  border-left: 3px solid var(--terracotta);
  border-radius: 3px;
}
.bloc-revenir-heure p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--encre);
}
.bloc-revenir-heure strong { color: var(--terracotta-fonce); }

/* ═══════════════════════════════════════════════════════════════════════
   V3.9.1 — Sélecteur de période transits (JOUR/SEMAINE/AUTRE) — S1 #6.1
═══════════════════════════════════════════════════════════════════════ */
.period-radio-group {
  display: flex;
  gap: 0;
  background: var(--ivoire);
  border: 1px solid var(--ivoire-fonce);
  border-radius: 4px;
  padding: 3px;
}
.period-radio {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--encre-clair);
  border-radius: 3px;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.period-radio input[type="radio"] {
  /* On cache la radio native, on stylise le label */
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.period-radio:hover {
  color: var(--encre);
}
.period-radio:has(input:checked) {
  background: var(--terracotta);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(83, 158, 218, 0.25);
}

.period-custom-fields {
  /* Animation d'apparition douce quand "Autre" est sélectionné */
  animation: period-fade-in 0.2s ease-out;
}
@keyframes period-fade-in {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

