/* ============================================================
   Porovnávač firemných úverov – styles.css
   Preserves original design system; adds comparison components
   ============================================================ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --sand:   rgb(247,241,231);
  --purple: rgb(51,43,106);
  --gold:   rgb(220,168,84);
}

/* ── Reset / base ───────────────────────────────────────────── */
* { box-sizing: border-box }
html, body { margin: 0; padding: 0 }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
               Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: var(--sand);
  color: var(--purple);
}
a { text-decoration: none; color: inherit }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 16px }
.section   { padding: 48px 0 }
.center    { text-align: center }

/* ── Header ─────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--gold);
  background: var(--purple); color: #fff;
}
.header-row {
  display: flex; align-items: center;
  justify-content: space-between; padding: 12px 0;
}
.logo-wrap { display: flex; gap: 12px; align-items: center }
.logo {
  width: 44px; height: 44px; display: flex; align-items: center;
  justify-content: center; background: var(--sand); color: var(--purple);
  border-radius: 12px; outline: 2px solid var(--gold); font-weight: 700;
}
.title-top { font-size: 18px; font-weight: 700; opacity: .95; white-space: nowrap; }
.title-sub { display: none; }
.nav { display: flex; gap: 16px; align-items: center; font-size: 14px }
.hide-md { display: none }
@media(min-width:768px) { .hide-md { display: inline } }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 14px;
  font-weight: 600; transition: transform .15s, box-shadow .15s;
  border: none; cursor: pointer; font-size: 14px;
}
.btn:hover { transform: scale(1.02) }
.btn-outline {
  border: 1px solid var(--gold); background: transparent;
  color: inherit;
}
.btn-gold {
  background: var(--gold); color: var(--purple);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.btn-purple {
  background: var(--purple); color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px }

/* ── Hero ────────────────────────────────────────────────────── */
.hero h1 { font-weight: 800; font-size: 36px; line-height: 1.15 }
@media(min-width:640px)  { .hero h1 { font-size: 48px } }
@media(min-width:1280px) { .hero h1 { font-size: 56px } }
.lead {
  opacity: .8; max-width: 640px; margin: 16px auto 0; line-height: 1.6;
}
.actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 24px; flex-wrap: wrap;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: #fff; border: 1px solid var(--gold);
  border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.06); padding: 24px;
}
.card-soft { background: rgba(255,255,255,.7) }
.card h3   { margin: 10px 0 6px; font-size: 18px }
.card p    { margin: 0; opacity: .85 }

.entry-card {
  display: flex; flex-direction: column; gap: 12px; align-items: center;
}
.entry-card p { margin-bottom: 8px }

/* ── Icon ────────────────────────────────────────────────────── */
.icon {
  width: 48px; height: 48px; border: 1px solid var(--gold);
  border-radius: 10px; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Features / entry grid ───────────────────────────────────── */
.features {
  display: grid; grid-template-columns: 1fr; gap: 20px;
  max-width: 720px; margin: 0 auto;
}
@media(min-width:640px) { .features { grid-template-columns: 1fr 1fr } }

/* ── Two-col ──────────────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr; gap: 24px }
@media(min-width:768px) { .two-col { grid-template-columns: 1fr 1fr } }
.two-col .left ul { margin: 12px 0 0 0; padding-left: 18px }
.two-col .left li { margin: 6px 0 }
.photo {
  background: #fff; opacity: .9; border: 1px solid var(--gold);
  border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.06);
  min-height: 260px; display: flex; align-items: center;
  justify-content: center; text-align: center; color: rgba(0,0,0,.5);
}

/* ── How it works ────────────────────────────────────────────── */
.how-grid {
  display: grid; gap: 24px; margin-top: 32px;
  grid-template-columns: 1fr;
}
@media(min-width:640px) { .how-grid { grid-template-columns: 1fr 1fr 1fr } }
.how-step { text-align: center }
.how-num {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--gold); color: var(--purple);
  font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.how-step h4 { margin: 0 0 6px; font-size: 16px }
.how-step p  { margin: 0; font-size: 14px; opacity: .75 }

/* ── Questionnaire ───────────────────────────────────────────── */
.quiz-section { background: rgba(51,43,106,.04) }
.quiz-card    { max-width: 680px; margin: 0 auto; padding: 32px }

.quiz-progress { margin-bottom: 32px }
.quiz-steps {
  display: flex; align-items: center; gap: 0;
  justify-content: center; margin-bottom: 10px;
}
.quiz-dot {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--gold); background: #fff;
  color: var(--purple); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
  flex-shrink: 0;
}
.quiz-dot.active { background: var(--gold); color: var(--purple) }
.quiz-dot.done   { background: var(--purple); color: #fff; border-color: var(--purple) }
.quiz-line {
  flex: 1; height: 2px; background: var(--gold);
  max-width: 80px; opacity: .4;
}
.quiz-step-label {
  text-align: center; margin: 0; font-size: 13px; opacity: .65;
}

.quiz-body h2 { margin: 0 0 20px; font-size: 22px }

.quiz-options {
  display: grid; gap: 10px;
  grid-template-columns: 1fr;
}
@media(min-width:480px) { .quiz-options { grid-template-columns: 1fr 1fr } }

.quiz-option {
  padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--gold); background: #fff;
  color: var(--purple); font-size: 15px; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s, transform .1s;
  text-align: left;
}
.quiz-option:hover    { background: var(--gold); color: var(--purple); transform: scale(1.01) }
.quiz-option.selected { background: var(--purple); color: #fff; border-color: var(--purple) }

.quiz-nav {
  display: flex; gap: 12px; margin-top: 24px;
  justify-content: space-between; align-items: center;
}

/* ── Recommendations ─────────────────────────────────────────── */
.rec-header { text-align: center; margin-bottom: 28px }
.rec-header h2  { margin-bottom: 8px }
.rec-header .lead { margin-bottom: 16px }

.rec-results { display: grid; gap: 16px }

.rec-card {
  background: #fff; border: 1px solid var(--gold);
  border-radius: 18px; padding: 20px 24px;
  display: flex; gap: 16px; align-items: flex-start;
  cursor: pointer; transition: box-shadow .15s, transform .15s;
  position: relative;
}
.rec-card:hover { box-shadow: 0 4px 16px rgba(51,43,106,.12); transform: translateY(-2px) }

.rec-rank {
  min-width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--purple);
  font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.rec-body { flex: 1 }
.rec-body h3 { margin: 8px 0 4px; font-size: 17px }
.rec-body p  { margin: 0 0 10px; font-size: 14px; opacity: .8 }

.rec-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}

.rec-score  { display: flex; align-items: center; gap: 8px }
.score-bar  {
  width: 80px; height: 6px; background: rgba(51,43,106,.1);
  border-radius: 3px; overflow: hidden;
}
.score-fill { height: 100%; border-radius: 3px; transition: width .4s }
.score-label { font-size: 12px; font-weight: 700; opacity: .75 }

.rec-meta {
  display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 13px; opacity: .75; margin-bottom: 8px;
}

.rec-reasons {
  margin: 6px 0 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.rec-reasons li {
  font-size: 12px; background: rgba(51,43,106,.07);
  color: var(--purple); padding: 3px 10px; border-radius: 20px;
}

.rec-detail-btn {
  align-self: center; flex-shrink: 0;
}

/* ── Filters ──────────────────────────────────────────────────── */
.compare-header { margin-bottom: 20px }
.compare-header h2 { margin: 0 0 4px }
.compare-sub { margin: 0; opacity: .65; font-size: 15px }

.filters {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: flex-end; margin-bottom: 20px;
}
.filter-group {
  display: flex; flex-direction: column; gap: 4px;
}
.filter-group label {
  font-size: 12px; font-weight: 600; opacity: .7; text-transform: uppercase;
  letter-spacing: .04em;
}
.filter-group select {
  padding: 8px 12px; border-radius: 10px;
  border: 1px solid var(--gold); background: #fff;
  color: var(--purple); font-size: 14px; cursor: pointer;
  min-width: 140px;
}
.filter-reset { margin-bottom: 0 }

/* ── Table ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--gold) }

.compare-table {
  width: 100%; border-collapse: collapse;
  background: #fff; font-size: 14px;
}
.compare-table thead th {
  background: var(--purple); color: #fff;
  padding: 12px 14px; text-align: left;
  font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; white-space: nowrap;
}
.compare-table thead th:first-child { border-radius: 14px 0 0 0 }
.compare-table thead th:last-child  { border-radius: 0 14px 0 0 }

.compare-table tbody tr {
  border-bottom: 1px solid rgba(220,168,84,.25);
  cursor: pointer; transition: background .12s;
}
.compare-table tbody tr:last-child { border-bottom: none }
.compare-table tbody tr:hover { background: rgba(220,168,84,.08) }
.compare-table tbody td { padding: 14px 14px; vertical-align: top }

.table-summary { font-size: 12px; opacity: .65; margin-top: 3px; max-width: 280px }
.table-loading  { text-align: center; padding: 40px; opacity: .6 }
.table-empty    { text-align: center; padding: 32px; opacity: .6 }

/* ── Bank badge ──────────────────────────────────────────────── */
.bank-badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}

/* ── Tags ─────────────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  background: rgba(51,43,106,.08); color: var(--purple);
  white-space: nowrap;
}
.tag-invest  { background: rgba(0,150,100,.1);  color: #006040 }
.tag-prev    { background: rgba(0,100,200,.1);  color: #003f80 }
.tag-komb    { background: rgba(220,168,84,.18); color: var(--purple) }

/* ── Spinner ──────────────────────────────────────────────────── */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(51,43,106,.2);
  border-top-color: var(--purple); border-radius: 50%;
  animation: spin .7s linear infinite; vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.45);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex }

.modal {
  background: #fff; border-radius: 20px;
  max-width: 680px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  position: relative; padding: 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(51,43,106,.07); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: 16px; color: var(--purple);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(51,43,106,.15) }

.modal-bank-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding-left: 12px;
}
.modal-title   { margin: 0 0 8px; font-size: 22px }
.modal-summary { margin: 0 0 24px; opacity: .75; line-height: 1.6 }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px; margin-bottom: 24px;
}
@media(min-width:480px) { .detail-grid { grid-template-columns: 1fr 1fr 1fr } }
.detail-item {
  background: rgba(51,43,106,.04); border-radius: 10px;
  padding: 10px 12px;
}
.detail-label { display: block; font-size: 11px; opacity: .6; margin-bottom: 4px; text-transform: uppercase }

.modal-content h3 { margin: 20px 0 8px; font-size: 16px }
.modal-content h4 { margin: 16px 0 6px; font-size: 14px }

.detail-list { margin: 0; padding-left: 18px }
.detail-list li { margin: 4px 0; font-size: 14px; opacity: .85 }

.detail-sources { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(220,168,84,.3) }
.detail-sources ul { margin: 6px 0 0; padding-left: 18px }
.detail-sources li { margin: 4px 0; font-size: 13px }
.detail-sources a  { color: var(--purple); text-decoration: underline; opacity: .75 }

/* ── Variants ────────────────────────────────────────────────── */
.variants-wrap { display: grid; gap: 12px }
.variant-card {
  border: 1px solid rgba(220,168,84,.4); border-radius: 12px;
  padding: 14px 16px;
}
.variant-card h4 { margin: 0 0 10px; font-size: 14px }
.variant-grid    { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 8px }
.variant-item    { font-size: 13px }
.variant-label   { display: block; font-size: 11px; opacity: .6; text-transform: uppercase; margin-bottom: 2px }
.variant-notes   { margin: 8px 0 0; font-size: 13px; opacity: .7; font-style: italic }

/* ── Footer ──────────────────────────────────────────────────── */
.footer { background: var(--purple); color: #fff; margin-top: 24px }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr; padding: 32px 16px }
@media(min-width:768px) { .footer-grid { grid-template-columns: 1fr 1fr 1fr 1fr } }
.footer h4 { margin: 0 0 8px 0 }
.footer ul { margin: 0; padding: 0; list-style: none }
.footer li { margin: 6px 0 }
.copy      { opacity: .8; font-size: 12px; padding: 10px 0 }

/* ── Cookie banner ───────────────────────────────────────────── */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 40;
}
.cookie-inner {
  max-width: 1120px; margin: 0 auto; background: #fff;
  color: var(--purple); border: 1px solid var(--gold);
  border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.1);
  padding: 14px; display: flex; gap: 12px;
  align-items: center; flex-wrap: wrap;
}
.cookie p       { margin: 0; flex: 1; opacity: .85; font-size: 14px }
.cookie-actions { display: flex; gap: 10px }

/* ── Mobile nav toggle (hamburger) ──────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: opacity .2s;
}

/* ── Mobile styles (≤767px) ─────────────────────────────────── */
@media (max-width: 767px) {

  /* Navigation */
  .nav-toggle { display: flex; }
  .header-row { position: relative; }
  .title-top  { white-space: normal; font-size: 14px; }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--purple);
    flex-direction: column;
    padding: 8px 16px 16px;
    gap: 0;
    border-top: 1px solid rgba(255,255,255,.15);
    z-index: 99;
  }
  .nav.nav-open { display: flex; }
  .nav a {
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    font-size: 15px;
    width: 100%;
    display: block;
  }
  .nav .btn {
    margin: 10px 0 0;
    border-bottom: none;
    text-align: center;
    width: 100%;
  }

  /* Spacing */
  .section         { padding: 28px 0; }
  .card            { padding: 16px; }
  .quiz-card       { padding: 20px 16px; }
  .entry-card      { padding: 20px 16px; }
  .footer-grid     { padding: 24px 16px; gap: 16px; }
  .copy            { padding: 12px 16px; font-size: 0.78rem; }

  /* Typography */
  h2               { font-size: 1.3rem; }
  .lead            { font-size: 1rem; }
  .quiz-card h2    { font-size: 1.15rem; }
  .compare-sub     { font-size: 0.9rem; }

  /* Touch targets */
  .btn             { min-height: 44px; }
  .quiz-option     { min-height: 48px; padding: 14px 12px; }
  .footer a        { display: inline-block; padding: 6px 0; }

  /* Filters — stack vertically */
  .filters         { flex-direction: column; align-items: stretch; }
  .filter-group    { width: 100%; }
  .filter-group select { width: 100%; min-width: unset; }
  .filter-reset    { width: 100%; }

  /* Comparison table — hide Splatnosť (col 4) and Typ (col 6) */
  .compare-table th:nth-child(4),
  .compare-table td:nth-child(4),
  .compare-table th:nth-child(6),
  .compare-table td:nth-child(6) { display: none; }
  .compare-table th, .compare-table td { padding: 10px 8px; font-size: 13px; }

  /* Modal */
  .modal           { padding: 20px 16px; border-radius: 14px; }
  .modal-close     { top: 12px; right: 12px; }
  .detail-grid     { grid-template-columns: 1fr 1fr; }

  /* Recommendation cards */
  .rec-card        { padding: 16px; flex-direction: column; gap: 12px; }
  .rec-header      { text-align: center; }
}

/* ── Small phones (≤480px) ──────────────────────────────────── */
@media (max-width: 480px) {
  .detail-grid     { grid-template-columns: 1fr; }
}
