/* Strona główna dla niezalogowanych (inc/home_guest.php).
   Każdy selektor zaczyna się od .mf-home: plik ładuje się w <head>, przed Bootstrapem,
   więc wyższa swoistość pilnuje, żeby Bootstrap go nie nadpisał, a style nie wyciekły.
   Pilnuje tego tests/home_css_test.php.
   Bootstrap 3 ustawia html na 10px, dlatego wymiary są w px, nie w rem. */

.mf-home {
  --mf-card: #ffffff;
  --mf-line: rgba(15, 23, 42, 0.1);
  --mf-soft: #f4f6f9;
  --mf-navy: #1e3a5f;
  --mf-navy-2: #152a45;
  --mf-accent: #2563eb;
  --mf-accent-d: #1d4ed8;
  --mf-green: #15803d;
  --mf-green-bg: #e8f6ee;
  --mf-red: #b91c1c;
  --mf-red-bg: #fdecec;
  --mf-text: #0f172a;
  --mf-muted: #475569;
  --mf-dim: #64748b;
  --mf-r: 14px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--mf-text);
  font-size: 15px;
  line-height: 1.5;
  padding-bottom: 40px;
  -webkit-font-smoothing: antialiased;
}

.mf-home *,
.mf-home *::before,
.mf-home *::after {
  box-sizing: border-box;
}

/* Bootstrap 3 nie zna atrybutu hidden na elementach z display:grid/flex. */
.mf-home [hidden] {
  display: none !important;
}

/* Stany hover i focus wymienione osobno: Bootstrap wczytuje się później i jego
   "a:hover" ma tę samą swoistość co ".mf-home a", więc by wygrał. */
.mf-home a,
.mf-home a:hover,
.mf-home a:focus {
  color: inherit;
  text-decoration: none;
}

.mf-home a:focus-visible,
.mf-home button:focus-visible,
.mf-home input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

.mf-home h1,
.mf-home h2,
.mf-home h3,
.mf-home p,
.mf-home ul {
  margin: 0;
  padding: 0;
  font-family: inherit;
}

/* ---------- Nagłówek z wyszukiwarką ---------- */

.mf-home .mf-hero {
  /* Poświata w rogu jak w nagłówku strony funduszu. Jako tło, a nie przycinany element,
     bo lista podpowiedzi wyszukiwarki musi móc wyjść poza nagłówek. */
  background:
    radial-gradient(circle at 92% -10%, rgba(96, 165, 250, 0.26) 0%, rgba(96, 165, 250, 0) 46%),
    linear-gradient(135deg, var(--mf-navy) 0%, var(--mf-navy-2) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 52px 48px 44px;
  margin-top: 6px;
}

.mf-home .mf-hero-in {
  position: relative;
  max-width: 760px;
}

.mf-home .mf-hero h1 {
  font-size: 40px;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-wrap: balance;
}

.mf-home .mf-hero-lead {
  font-size: 17px;
  line-height: 1.55;
  color: #c7d5e8;
  margin-top: 14px !important;
  max-width: 620px;
}

.mf-home .mf-search {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  margin-top: 28px;
  max-width: 680px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.mf-home .mf-search-ico {
  flex: 0 0 auto;
  color: var(--mf-dim);
}

.mf-home .mf-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  border: 0;
  outline: 0;
  box-shadow: none;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: var(--mf-text);
  padding: 0 12px;
  -webkit-appearance: none;
  appearance: none;
}

.mf-home .mf-search input[type="search"]::placeholder {
  color: #64748b;
}

.mf-home .mf-search:focus-within {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(96, 165, 250, 0.7);
}

.mf-home .mf-search button {
  flex: 0 0 auto;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--mf-accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0 24px;
  cursor: pointer;
}

.mf-home .mf-search button:hover {
  background: var(--mf-accent-d);
}

.mf-home .mf-suggest {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--mf-line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.2);
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}

.mf-home .mf-suggest a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--mf-text);
  font-size: 15px;
}

.mf-home .mf-suggest a:hover,
.mf-home .mf-suggest a.is-active {
  background: var(--mf-soft);
}

.mf-home .mf-suggest .mf-sg-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mf-home .mf-suggest .mf-sg-pct {
  flex: 0 0 auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mf-home .mf-suggest .mf-sg-empty {
  padding: 10px 12px;
  color: var(--mf-muted);
}

.mf-home .mf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.mf-home .mf-chip {
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #e2ebf7;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
}

.mf-home .mf-chip:hover,
.mf-home .mf-chip:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mf-home .mf-hero-meta {
  margin-top: 24px !important;
  font-size: 13.5px;
  color: #a9bbd3;
}

.mf-home .mf-hero-meta b {
  color: #fff;
  font-weight: 600;
}

/* ---------- Sekcje ---------- */

.mf-home .mf-sec {
  margin-top: 40px;
}

.mf-home .mf-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.mf-home h2 {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--mf-text);
}

.mf-home .mf-sub {
  color: var(--mf-muted);
  font-size: 14px;
  margin-top: 4px !important;
}

.mf-home .mf-card {
  background: var(--mf-card);
  border: 1px solid var(--mf-line);
  border-radius: var(--mf-r);
}

.mf-home a.mf-card,
.mf-home .mf-companies a {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mf-home a.mf-card:hover,
.mf-home .mf-companies a:hover {
  border-color: #a9bbd3;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.mf-home .mf-link-btn {
  border: 0;
  background: transparent;
  color: var(--mf-accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
}

/* ---------- Ostatnio przeglądane ---------- */

.mf-home .mf-recent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.mf-home .mf-rc {
  display: block;
  padding: 14px 16px;
  min-width: 0;
}

.mf-home .mf-rc-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-home .mf-rc-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin-top: 8px;
}

.mf-home .mf-rc-val {
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mf-home .mf-rc-chg {
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.mf-home .mf-rc-date {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--mf-dim);
}

/* ---------- Dziś na rynku ---------- */

.mf-home .mf-seg {
  display: inline-flex;
  background: #e6eaf0;
  border-radius: 10px;
  padding: 3px;
}

.mf-home .mf-seg-btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--mf-muted);
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.mf-home .mf-seg-btn.is-on {
  background: #fff;
  color: var(--mf-text);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.mf-home .mf-movers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.mf-home .mf-list {
  overflow: hidden;
  min-width: 0;
}

.mf-home .mf-list h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  padding: 16px 20px 12px;
  color: var(--mf-text);
}

.mf-home .mf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mf-home .mf-dot.mf-up {
  background: var(--mf-green);
}

.mf-home .mf-dot.mf-dn {
  background: var(--mf-red);
}

.mf-home .mf-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 20px;
  border-top: 1px solid var(--mf-line);
}

.mf-home a.mf-row:hover,
.mf-home a.mf-row:focus {
  background: #f8fafc;
}

.mf-home .mf-row-n {
  color: var(--mf-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mf-home .mf-row-main {
  min-width: 0;
}

.mf-home .mf-row-name,
.mf-home .mf-row-cat {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-home .mf-row-name {
  font-weight: 600;
  font-size: 14.5px;
}

.mf-home .mf-row-cat {
  color: var(--mf-dim);
  font-size: 12.5px;
  margin-top: 1px;
}

.mf-home .mf-row-val {
  color: var(--mf-muted);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.mf-home .mf-pill {
  min-width: 76px;
  text-align: right;
  font-weight: 700;
  font-size: 13.5px;
  padding: 4px 9px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mf-home .mf-pill.mf-up {
  color: var(--mf-green);
  background: var(--mf-green-bg);
}

.mf-home .mf-pill.mf-dn {
  color: var(--mf-red);
  background: var(--mf-red-bg);
}

.mf-home .mf-more {
  margin-top: 14px !important;
  font-size: 14px;
  font-weight: 600;
}

.mf-home .mf-more a {
  color: var(--mf-accent);
}

.mf-home .mf-more a:hover {
  text-decoration: underline;
}

/* ---------- Liderzy kategorii ---------- */

.mf-home .mf-leaders {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mf-home .mf-leader {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  min-width: 0;
}

.mf-home .mf-leader-cat {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--mf-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mf-home .mf-leader-name {
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.35;
  margin: 8px 0 14px;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

.mf-home .mf-leader-pct {
  font-size: 26px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mf-home .mf-leader-pct.mf-up {
  color: var(--mf-green);
}

.mf-home .mf-leader-pct.mf-dn {
  color: var(--mf-red);
}

.mf-home .mf-leader-lbl {
  font-size: 12.5px;
  color: var(--mf-dim);
  margin-top: 2px;
}

/* ---------- Darmowe konto ---------- */

.mf-home .mf-cta {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border-radius: 18px;
  padding: 36px 40px;
}

.mf-home .mf-cta h2 {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  text-wrap: balance;
}

.mf-home .mf-cta p {
  color: #dbe7ff;
  font-size: 15.5px;
  line-height: 1.55;
  margin: 10px 0 22px;
}

.mf-home .mf-cta-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mf-home .mf-btn {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}

.mf-home .mf-btn-light {
  background: #fff;
  color: var(--mf-accent-d);
  font-weight: 700;
}

.mf-home .mf-btn-light:hover,
.mf-home .mf-btn-light:focus {
  background: #eef4ff;
  color: var(--mf-accent-d);
}

.mf-home .mf-btn-ghost {
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.mf-home .mf-btn-ghost:hover,
.mf-home .mf-btn-ghost:focus {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.mf-home .mf-btn-outline {
  border-color: var(--mf-line);
  color: var(--mf-text);
  background: #fff;
}

.mf-home .mf-btn-outline:hover,
.mf-home .mf-btn-outline:focus {
  border-color: #a9bbd3;
  color: var(--mf-text);
}

.mf-home .mf-cta ul {
  list-style: none;
  display: grid;
  gap: 12px;
}

.mf-home .mf-cta li {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
}

.mf-home .mf-cta li b {
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
}

.mf-home .mf-cta li span {
  font-size: 13.5px;
  line-height: 1.45;
  color: #dbe7ff;
}

/* ---------- Narzędzia, towarzystwa, PRO ---------- */

.mf-home .mf-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mf-home .mf-tool {
  display: block;
  padding: 18px;
}

.mf-home .mf-tool b {
  display: block;
  font-size: 15.5px;
  margin-bottom: 6px;
}

.mf-home .mf-tool span {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--mf-muted);
}

.mf-home .mf-companies {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.mf-home .mf-companies a {
  background: #fff;
  border: 1px solid var(--mf-line);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mf-home .mf-pro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 22px 26px;
}

.mf-home .mf-pro b {
  font-size: 17px;
}

.mf-home .mf-pro span {
  display: block;
  color: var(--mf-muted);
  font-size: 14px;
  margin-top: 4px;
}

.mf-home .mf-seo {
  color: var(--mf-muted);
  font-size: 14.5px;
  line-height: 1.65;
  max-width: 820px;
}

/* ---------- Węższe ekrany ---------- */

@media (max-width: 991px) {
  .mf-home .mf-leaders,
  .mf-home .mf-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mf-home .mf-cta {
    grid-template-columns: 1fr;
    padding: 28px 24px;
  }
}

@media (max-width: 767px) {
  .mf-home .mf-hero {
    padding: 32px 22px 28px;
    border-radius: 14px;
  }

  .mf-home .mf-hero h1 {
    font-size: 29px;
  }

  .mf-home .mf-hero-lead {
    font-size: 16px;
  }

  .mf-home .mf-sec {
    margin-top: 32px;
  }

  .mf-home h2 {
    font-size: 21px;
  }

  .mf-home .mf-movers {
    grid-template-columns: minmax(0, 1fr);
  }

  .mf-home .mf-row {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    padding: 11px 14px;
    gap: 10px;
  }

  .mf-home .mf-row-val {
    display: none;
  }

  .mf-home .mf-list h3 {
    padding: 14px 14px 10px;
  }

  .mf-home .mf-seg {
    width: 100%;
  }

  .mf-home .mf-seg-btn {
    flex: 1 1 0;
    padding: 9px 6px;
  }
}

@media (max-width: 480px) {
  .mf-home .mf-search {
    padding-left: 12px;
  }

  .mf-home .mf-search-ico {
    display: none;
  }

  .mf-home .mf-search input[type="search"] {
    font-size: 16px;
    padding: 0 6px;
  }

  .mf-home .mf-search button {
    padding: 0 16px;
  }

  .mf-home .mf-tools {
    grid-template-columns: minmax(0, 1fr);
  }

  .mf-home .mf-leader {
    padding: 14px;
  }

  .mf-home .mf-leader-pct {
    font-size: 22px;
  }

  .mf-home .mf-recent,
  .mf-home .mf-companies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mf-home .mf-cta h2 {
    font-size: 23px;
  }

  .mf-home .mf-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mf-home * {
    transition: none !important;
  }
}
