/* ==========================================================================
   Get me home — design system
   Direction : un phare qu'on consulte de nuit, fatigué, dans une ville
   inconnue. Fond profond pour ménager les yeux, un seul accent chaud (le
   "beacon") qui indique la direction du domicile, typographie lisible au
   pouce et au regard flou.
   ========================================================================== */

:root {
  --navy-950: #0a0f1a;
  --navy-900: #10192b;
  --navy-800: #182338;
  --navy-700: #22314a;
  --navy-600: #354a68;

  --fog-300: #c7d0de;
  --fog-500: #8fa0b8;
  --white: #f4f7fb;

  --amber-400: #ffd479;
  --amber-500: #f2b84b;
  --amber-600: #c48c3a;

  --danger: #e2785f;
  --success: #7fd0a3;

  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 90% at 50% -10%, var(--navy-800) 0%, var(--navy-950) 60%);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  margin: 0;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--amber-400);
}

button {
  font-family: inherit;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ---------------------------------------------------------------------- */
/* Beacon mark (logo)                                                     */
/* ---------------------------------------------------------------------- */

.beacon-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
}
.beacon-mark svg {
  width: 100%;
  height: 100%;
}
.beacon-mark__glow {
  fill: var(--amber-500);
  opacity: 0.14;
}
.beacon-mark__needle {
  fill: var(--amber-500);
}
.beacon-mark__hub {
  fill: var(--navy-950);
}

/* ---------------------------------------------------------------------- */
/* Onboarding                                                             */
/* ---------------------------------------------------------------------- */

.onboarding {
  padding-top: 8vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.onboarding__beacon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.onboarding__beacon .beacon-mark {
  width: 84px;
  height: 84px;
}

.onboarding__title {
  font-size: clamp(2rem, 7vw, 2.6rem);
  letter-spacing: -0.01em;
}

.onboarding__lead {
  color: var(--fog-300);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 40ch;
  margin-bottom: 12px;
}

.onboarding__privacy {
  color: var(--fog-500);
  font-size: 0.8rem;
  line-height: 1.5;
  max-width: 42ch;
  margin-top: 6px;
}

.form {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--navy-900);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.label {
  font-size: 0.8rem;
  color: var(--fog-300);
  font-weight: 600;
  margin-top: 8px;
}
.label--optional {
  color: var(--fog-500);
  font-weight: 500;
}

.input {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--navy-700);
  background: var(--navy-950);
  color: var(--white);
  font-size: 1rem;
}
.input:focus {
  outline: 2px solid var(--amber-500);
  outline-offset: 1px;
}

.suggestions {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}
.suggestions li {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--fog-300);
}
.suggestions li:hover,
.suggestions li:focus {
  background: var(--navy-800);
  color: var(--white);
  outline: none;
}

.form__feedback {
  font-size: 0.85rem;
  min-height: 1.2em;
  color: var(--fog-500);
}
.form__feedback--error {
  color: var(--danger);
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                */
/* ---------------------------------------------------------------------- */

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn--primary {
  background: linear-gradient(180deg, var(--amber-400), var(--amber-500));
  color: var(--navy-950);
}
.btn--ghost {
  background: var(--navy-800);
  color: var(--fog-300);
  border: 1px solid var(--navy-700);
}
.btn--danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(226, 120, 95, 0.4);
}
.btn--call {
  background: var(--success);
  color: var(--navy-950);
}
.btn--block {
  width: 100%;
}
.btn--sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--navy-700);
  background: var(--navy-900);
  color: var(--fog-300);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* ---------------------------------------------------------------------- */
/* Topbar                                                                 */
/* ---------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Offline banner                                                        */
/* ---------------------------------------------------------------------- */

.banner {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  line-height: 1.45;
}
.banner--offline {
  background: rgba(226, 120, 95, 0.12);
  border: 1px solid rgba(226, 120, 95, 0.35);
  color: var(--fog-300);
}

/* ---------------------------------------------------------------------- */
/* Hero — signature beacon compass                                       */
/* ---------------------------------------------------------------------- */

.hero-slot {
  margin-bottom: 18px;
}

.hero {
  background: radial-gradient(120% 140% at 50% 0%, var(--navy-700) 0%, var(--navy-900) 70%);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.hero--waiting {
  padding: 40px 20px;
}

.hero__ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--navy-700);
  border-top-color: var(--amber-500);
  animation: spin 1.1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.hero__ring--stopped {
  animation: none;
  border-color: var(--navy-700);
  display: grid;
  place-items: center;
  color: var(--danger);
  font-size: 1.3rem;
}
.hero__label {
  color: var(--fog-300);
  font-size: 0.9rem;
}

.hero__compass {
  position: relative;
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
}
.hero__needle {
  position: absolute;
  inset: 0;
  transform: rotate(var(--bearing, 0deg));
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__dial {
  fill: var(--navy-950);
  stroke: var(--navy-700);
  stroke-width: 1.5;
}
.hero__needle-fill {
  fill: var(--amber-500);
  filter: drop-shadow(0 0 10px rgba(242, 184, 75, 0.55));
}
.hero__hub {
  fill: var(--fog-300);
}
.hero__reading {
  position: relative;
  z-index: 2;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: var(--navy-950);
  box-shadow: 0 0 0 1px var(--navy-700), inset 0 0 24px rgba(242, 184, 75, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  pointer-events: none;
}
.hero__distance {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.1;
}
.hero__caption {
  font-size: 0.66rem;
  color: var(--fog-500);
  max-width: 13ch;
  line-height: 1.3;
}
.hero__sub {
  color: var(--fog-300);
  font-size: 0.88rem;
}

/* ---------------------------------------------------------------------- */
/* Cards / sections                                                       */
/* ---------------------------------------------------------------------- */

.card {
  background: var(--navy-900);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--amber-500);
  letter-spacing: 0.08em;
  margin: 0 0 2px;
}
.card__title {
  font-size: 1.05rem;
}
.badge {
  background: var(--navy-800);
  color: var(--fog-300);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

.big-value {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
}

.muted {
  color: var(--fog-500);
  font-size: 0.88rem;
}
.note {
  color: var(--fog-500);
  font-size: 0.78rem;
  margin-top: 8px;
  line-height: 1.4;
}

/* ---------------------------------------------------------------------- */
/* State (loading / error / empty)                                       */
/* ---------------------------------------------------------------------- */

.state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fog-300);
  font-size: 0.9rem;
  flex-wrap: wrap;
}
.state--error {
  color: var(--danger);
}
.state__icon {
  font-size: 1rem;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--navy-700);
  border-top-color: var(--amber-500);
  animation: spin 0.8s linear infinite;
  flex: none;
}

/* ---------------------------------------------------------------------- */
/* Coordinates block                                                      */
/* ---------------------------------------------------------------------- */

.coords {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 14px;
  margin: 0 0 14px;
}
.coords dt {
  color: var(--fog-500);
  font-size: 0.82rem;
}
.coords dd {
  margin: 0;
  font-size: 0.92rem;
}

/* ---------------------------------------------------------------------- */
/* Lists (taxis / gares / hébergements)                                  */
/* ---------------------------------------------------------------------- */

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--navy-950);
  border: 1px solid var(--navy-700);
  border-radius: var(--radius-sm);
}
.list__item--stack {
  flex-direction: column;
  align-items: stretch;
}
.list__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.list__title {
  font-weight: 600;
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list__meta {
  color: var(--fog-500);
  font-size: 0.8rem;
}
.list__nophone {
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Settings sheet                                                         */
/* ---------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}
.sheet {
  width: 100%;
  max-width: 560px;
  background: var(--navy-900);
  border: 1px solid var(--navy-700);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 88vh;
  overflow-y: auto;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sheet__divider {
  border: none;
  border-top: 1px solid var(--navy-700);
  margin: 14px 0;
}
.sheet__meta {
  color: var(--fog-500);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* ---------------------------------------------------------------------- */
/* Accessibility                                                          */
/* ---------------------------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 640px) {
  #app {
    padding-top: 32px;
  }
}
