/*
  style.css
  =========
  Fișierul de stil comun pentru aplicația curentă.

  Structură:
  1. Variabile de temă (light / dark)
  2. Elemente de bază și layout global
  3. Componente generale (butoane, carduri, formulare)
  4. Popup-uri și elemente globale
  5. Footer, README și lightbox logo
  6. Interfața compactă

  Notă:
  Majoritatea culorilor și spațierilor sunt centralizate în variabilele CSS de
  la începutul fișierului, ca modificările să fie ușor de făcut ulterior.
*/

/* =========================
   1. Variabile de temă
   ========================= */
/*
  Scalare UI:
  Pentru această versiune, interfața a fost redusă uniform la aproximativ 80%
  prin ajustarea dimensiunilor principale: fonturi, spațieri, carduri, butoane,
  controale și elemente de hartă.
*/
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --text: #1b2230;
  --muted: #5d687a;
  --border: #d8ddea;
  --accent: #2f6fed;
  --accent-2: #1f56be;
  --success: #0f9d58;
  --danger: #c63f3f;
  --shadow: 0 11px 32px rgba(18, 29, 53, 0.08);
}
body.dark {
  --bg: #0e1117;
  --surface: #161b22;
  --surface-2: #0f141b;
  --text: #eef2f7;
  --muted: #a8b2c1;
  --border: #2d3748;
  --accent: #6ea8fe;
  --accent-2: #8bb9ff;
  --success: #45c47c;
  --danger: #ff7b72;
  --shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
}
/* =========================
   2. Reset minim și structură globală
   ========================= */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
/* Container comun folosit pentru lățime controlată. */
.container {
  width: min(1200px, calc(100% - 26px));
  margin: 0 auto;
}
/* Bara de sus este sticky pentru acces rapid la navigație și la selectorul de temă. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.topbar .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 11px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  letter-spacing: 0.01em;
  font-size: clamp(22px, 2.72vw, 32px);
  line-height: 1;
}
.brand-logo {
  width: 51px;
  height: 51px;
  display: block;
  flex: 0 0 auto;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.brand-text {
  display: inline-block;
}
.theme-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
}
/* =========================
   3. Componente generale
   ========================= */
.hero {
  padding: 43px 0 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
}
.hero h1 {
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.02;
  margin: 18px 0 14px;
}
.hero p {
  max-width: 880px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 19px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 19px;
  box-shadow: var(--shadow);
}
.card.pad {
  padding: 19px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 22px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 13px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}
.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.btn.primary:hover {
  background: var(--accent-2);
}
.btn.small {
  padding: 8px 11px;
  font-size: 11px;
  border-radius: 11px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.section {
  padding: 14px 0 27px;
}
.section h2 {
  margin: 0 0 16px;
  font-size: 14px;
}
.muted {
  color: var(--muted);
}
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}
.step,
.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px;
  box-shadow: var(--shadow);
}
.step .num {
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-bottom: 8px;
}
/* Grilă standard folosită pentru formulare. */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 13px;
}
.field {
  grid-column: span 12;
}
.field.half {
  grid-column: span 6;
}
.field.third {
  grid-column: span 4;
}
label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
input[type="text"],
input[type="number"],
input[type="file"],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 11px;
  font: inherit;
}
textarea {
  min-height: 74px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 88%, transparent);
  opacity: 1;
}
.help {
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  align-items: stretch;
}
.kpi {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 11px;
  background: var(--surface-2);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi .label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  min-height: 26px;
  display: flex;
  align-items: flex-start;
}
.kpi .value {
  font-size: 21px;
  font-weight: 800;
  margin-top: 6px;
  line-height: 1.1;
  display: flex;
  align-items: flex-end;
  min-height: 24px;
}
/* Lista dinamică de puncte este populată din JavaScript în funcție de fișierele sursă. */
.points-list {
  display: grid;
  gap: 11px;
}
.point-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px;
  background: var(--surface-2);
}
.point-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.point-title strong {
  font-size: 14px;
}
/* Bara de acțiuni principală din convertoarele detaliate. */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 11px;
}
/* Mesaje de stare afișate după detectare, generare sau erori. */
.status {
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.status.success {
  border-color: color-mix(in srgb, var(--success) 55%, var(--border));
  color: var(--success);
}
.status.error {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
  color: var(--danger);
}
.footer {
  padding: 18px 0 32px;
  color: var(--muted);
  font-size: 11px;
}
.list {
  margin: 0;
  padding-left: 14px;
  color: var(--muted);
  line-height: 1.7;
}
.notice {
  border-left: 4px solid var(--accent);
  padding: 11px 13px;
  background: var(--surface-2);
  border-radius: 0 13px 13px 0;
  color: var(--muted);
}
@media (max-width: 940px) {
  .grid-2,
  .steps,
  .kpis {
    grid-template-columns: 1fr;
  }
  .field.half,
  .field.third {
    grid-column: span 12;
  }
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
}
/* =========================
   4. Popup-uri și hartă Leaflet
   ========================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 19px;
}
.modal[hidden] {
  display: none;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.66);
}
.modal-panel {
  position: relative;
  width: min(1024px, calc(100vw - 26px));
  max-height: calc(100vh - 26px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.map-panel {
  padding: 14px;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  margin-bottom: 10px;
}
.map-meta {
  color: var(--muted);
  margin-bottom: 14px;
}
.map-view {
  width: 100%;
  height: min(72vh, 688px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.leaflet-container {
  background: #d9e6f2;
}
body.dark .leaflet-container {
  background: #0b1220;
}
.leaflet-control.custom-fullscreen a {
  width: 27px;
  height: 27px;
  line-height: 27px;
  display: block;
  text-align: center;
  text-decoration: none;
  color: #111827;
  font-size: 14px;
}
body.dark .leaflet-control.custom-fullscreen a {
  color: #111827;
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
}
.leaflet-control-attribution {
  font-size: 11px;
}
@media (max-width: 720px) {
  .modal {
    padding: 12px;
  }
  .modal-panel {
    width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
    border-radius: 16px;
  }
  .map-panel {
    padding: 12px;
  }
  .map-view {
    height: 68vh;
    border-radius: 13px;
  }
}

/* =========================
   5. Footer, README și lightbox logo
   ========================= */
.footer-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.site-footer {
  margin-top: auto;
}
.credit-link {
  color: var(--muted);
  font-weight: 700;
}
.credit-link:hover {
  color: var(--text);
}
.readme-panel {
  padding: 14px;
  overflow: auto;
}
.readme-content {
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding-right: 6px;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 14px 0 8px;
}
.markdown-body h1 {
  font-size: 24px;
}
.markdown-body h2 {
  font-size: 22px;
}
.markdown-body h3 {
  font-size: 18px;
}
.markdown-body p,
.markdown-body li {
  color: var(--muted);
  line-height: 1.7;
}
.markdown-body ul,
.markdown-body ol {
  padding-left: 18px;
}
.markdown-body code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 5px;
}

.logo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
}
.logo-lightbox[hidden] {
  display: none;
}
.logo-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
}
.logo-lightbox-image {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 784px);
  max-height: 88vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 16px 40px rgba(0, 0, 0, 0.28));
}
.brand-logo {
  cursor: zoom-in;
}

/* =========================
   6. Interfața compactă
   ========================= */
.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Layout-ul compact adună tot fluxul de lucru într-o singură pagină. */
.compact-page {
  padding: 14px 0 8px;
}
.compact-layout {
  display: grid;
  grid-template-columns: minmax(272px, 344px) minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}
.compact-sidebar {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.compact-card {
  padding: 13px;
  border-radius: 16px;
}
.compact-card-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.compact-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.compact-actions-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.compact-form-grid {
  display: grid;
  gap: 10px;
}
.compact-status {
  margin-bottom: 12px;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.seg-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 11px;
  padding: 10px 11px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.seg-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.compact-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.compact-summary-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 10px 11px;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.compact-summary-item span {
  color: var(--muted);
  font-size: 11px;
}
.compact-summary-item strong {
  font-size: 22px;
  line-height: 1;
}
.compact-route-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 11px;
}
.compact-subtitle {
  margin-top: 4px;
}
.compact-points-list .point-card {
  padding: 14px;
}
.compact-points-list .point-title strong {
  font-size: 13px;
}
/* Harta este sticky pe ecrane mari pentru a rămâne vizibilă în timpul completării formularului. */
.compact-map-wrap {
  min-width: 0;
  position: sticky;
  top: var(--compact-sticky-top, 69px);
  align-self: start;
}
.compact-map-card {
  padding: 11px;
  border-radius: 19px;
}
.compact-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.compact-map-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.compact-map-view {
  width: 100%;
  height: min(
    calc(100vh - var(--compact-sticky-top, 69px) - 27px),
    78vh,
    688px
  );
  min-height: 288px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #d9e6f2;
}
body.dark .compact-map-view {
  background: #0b1220;
}
/* Markerii numerotați reflectă ordinea punctelor în exportul final. */
.numbered-marker {
  background: transparent;
  border: 0;
}
.numbered-marker .pin {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-size: 11px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
/* Adaptări responsive pentru tablete și ecrane mici. */
@media (max-width: 860px) {
  .compact-layout {
    grid-template-columns: 1fr;
  }
  .compact-map-wrap {
    position: static;
  }
  .compact-map-view {
    height: 42vh;
  }
}
@media (max-width: 760px) {
  .topbar .inner {
    flex-wrap: wrap;
  }
  .brand {
    font-size: clamp(16px, 4.8vw, 24px);
  }
  .brand-logo {
    width: 38px;
    height: 38px;
  }
  .compact-route-fields {
    grid-template-columns: 1fr;
  }
  .compact-actions-inline {
    justify-content: flex-start;
  }
}
