/* ============================================================
   learn.souleconomy.cz – hlavní stylesheet
   Primární: #f57b22  Pozadí: #52606d  Boxy: #7b8794
   ============================================================ */

:root {
  --orange:   #f57b22;
  --orange-d: #d9681a;
  --bg:       #52606d;
  --bg-dark:  #3d4a55;
  --box:      #7b8794;
  --box-light:#8e9aa6;
  --white:    #ffffff;
  --text:     #1a1a1a;
  --text-m:   #444;
  --text-l:   #666;
  --border:   rgba(255,255,255,0.15);
  --success:  #2ecc71;
  --danger:   #e74c3c;
  --warning:  #f39c12;
  --radius:   8px;
  --radius-lg:14px;
  --shadow:   0 2px 12px rgba(0,0,0,0.18);
  --shadow-sm:0 1px 4px rgba(0,0,0,0.12);
  --font:     'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--white);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- TYPOGRAPHY ---- */
h1 { font-size: 2rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.5rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p  { margin-bottom: 1rem; color: rgba(255,255,255,0.85); }
a  { color: var(--orange); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--orange-d); }

/* ---- LAYOUT ---- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-sm {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- HEADER / NAV ---- */
.site-header {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-logo img {
  height: 56px;
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: rgba(255,255,255,0.75);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.nav-user-name {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}

/* ---- MAIN CONTENT ---- */
.main {
  padding: 40px 0 80px;
}

.page-title {
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 32px;
}

/* ---- CARDS ---- */
.card {
  background: var(--box);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid rgba(255,255,255,0.08);
}

.card-sm {
  background: var(--box);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

.card-white {
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-white p { color: var(--text-m); }
.card-white h1, .card-white h2, .card-white h3, .card-white h4 { color: var(--text); }

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--white);
}

.card-white .card-title { color: var(--text); }

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--box);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}
.btn-primary:hover { background: var(--orange-d); color: var(--white); transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); color: var(--white); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { background: #c0392b; color: var(--white); }

.btn-success {
  background: var(--success);
  color: var(--white);
}
.btn-success:hover { background: #27ae60; color: var(--white); }

.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--white); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--transition), background var(--transition);
}

.form-control::placeholder { color: rgba(255,255,255,0.35); }
.form-control:focus { outline: none; border-color: var(--orange); background: rgba(255,255,255,0.15); }

.form-control-white {
  background: #fff;
  border: 1px solid #ddd;
  color: var(--text);
}
.form-control-white:focus { border-color: var(--orange); }
.form-control-white::placeholder { color: #aaa; }

select.form-control option { background: var(--bg-dark); color: var(--white); }

textarea.form-control { resize: vertical; min-height: 120px; }

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.form-check input[type="checkbox"] {
  width: 18px; height: 18px;
  accent-color: var(--orange);
  cursor: pointer;
}

.form-hint {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 580px) { .form-row { grid-template-columns: 1fr; } }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-success { background: rgba(46,204,113,0.15); border-color: rgba(46,204,113,0.3); color: #2ecc71; }
.alert-error   { background: rgba(231,76,60,0.15);  border-color: rgba(231,76,60,0.3);  color: #e74c3c; }
.alert-warning { background: rgba(243,156,18,0.15); border-color: rgba(243,156,18,0.3); color: #f39c12; }
.alert-info    { background: rgba(245,123,34,0.12); border-color: rgba(245,123,34,0.3); color: var(--orange); }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  vertical-align: middle;
}

.table tr:hover td { background: rgba(255,255,255,0.04); }

.table-white { background: #fff; }
.table-white th { color: var(--text-l); border-bottom: 1px solid #eee; }
.table-white td { color: var(--text-m); border-bottom: 1px solid #f5f5f5; }
.table-white tr:hover td { background: #fafafa; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success  { background: rgba(46,204,113,0.2);  color: #2ecc71; }
.badge-danger   { background: rgba(231,76,60,0.2);   color: #e74c3c; }
.badge-warning  { background: rgba(243,156,18,0.2);  color: #f39c12; }
.badge-info     { background: rgba(245,123,34,0.15); color: var(--orange); }
.badge-default  { background: rgba(255,255,255,0.12);color: rgba(255,255,255,0.7); }

/* ---- PROGRESS BAR ---- */
.progress {
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 20px;
  transition: width 0.5s ease;
}

.progress-bar-success { background: var(--success); }

/* ---- CHAPTER LIST ---- */
.chapter-list { list-style: none; }

.chapter-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.chapter-item:last-child { border-bottom: none; }

.chapter-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  color: rgba(255,255,255,0.5);
  flex-shrink: 0;
}

.chapter-num.done {
  background: var(--orange);
  color: #fff;
}

.chapter-item a { color: rgba(255,255,255,0.85); font-weight: 500; }
.chapter-item a:hover { color: var(--orange); }
.chapter-item.done-item a { color: rgba(255,255,255,0.5); }

.chapter-check {
  margin-left: auto;
  color: var(--success);
  font-size: 1.1rem;
}

/* ---- TEST / QUIZ ---- */
.question-card {
  background: var(--box);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.08);
}

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--white);
}

.answer-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.answer-option:hover { border-color: var(--orange); background: rgba(245,123,34,0.08); }

.answer-option input[type="radio"] { margin-top: 2px; accent-color: var(--orange); }

.answer-option.selected { border-color: var(--orange); background: rgba(245,123,34,0.12); }

/* ---- LOGIN PAGE ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--box);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.1);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img { height: 44px; }

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.login-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  margin-bottom: 28px;
}

/* ---- ADMIN SIDEBAR ---- */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 0 20px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-logo img { height: 50px; }

.sidebar-section {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 0;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}

.sidebar-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.07);
}

.sidebar-link.active {
  color: var(--orange);
  border-left-color: var(--orange);
  background: rgba(245,123,34,0.08);
}

.admin-content { padding: 36px 40px; }

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .admin-content { padding: 24px 20px; }
}

/* ---- SHOP / REGISTER ---- */
.shop-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.shop-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 40px;
}

.shop-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.shop-step::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.15);
}

.shop-step:last-child::after { display: none; }

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 6px;
  font-size: 0.85rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.step-circle.active { background: var(--orange); }
.step-circle.done   { background: var(--success); }

.step-label { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

/* ---- CERTIFICATE ---- */
.cert-result {
  text-align: center;
  padding: 48px 24px;
}

.cert-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(46,204,113,0.15);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-size: 2rem;
}

.cert-icon.fail { background: rgba(231,76,60,0.15); }

.score-display {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 4px;
}

/* ---- MISC ---- */
.divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 24px 0;
}

.text-orange { color: var(--orange); }
.text-muted  { color: rgba(255,255,255,0.5); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: 0.85rem; }

.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.gap-16      { gap: 16px; }
.gap-24      { gap: 24px; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
  .container, .container-sm { padding: 0 16px; }
  .card { padding: 20px; }
  .main { padding: 24px 0 60px; }
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.35);
}

/* ---- ORANGE HIGHLIGHT BOX ---- */
.highlight-box {
  background: rgba(245,123,34,0.12);
  border: 1px solid rgba(245,123,34,0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

/* ---- SCENARIO BOX ---- */
.scenario-box {
  background: rgba(0,0,0,0.2);
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-style: italic;
}

.scenario-box strong { color: var(--orange); font-style: normal; }

/* ---- RULES BOX ---- */
.rules-box {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
}

.rules-box ul { padding-left: 20px; }
.rules-box li { margin-bottom: 6px; color: rgba(255,255,255,0.8); }

/* ============================================================
   MOBILE FIXES
   ============================================================ */

/* Registrace – typ organizace na mobilu jako řádky místo 3 sloupců */
@media (max-width: 640px) {
  .shop-wrap { padding: 20px 16px; }

  .type-selector {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .type-card {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
  }
  .type-card .type-icon {
    font-size: 1.6rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .type-card p {
    margin: 0;
  }

  /* Formulářové řádky – vždy jeden sloupec */
  .form-row {
    grid-template-columns: 1fr !important;
  }

  /* Kalkulátor ceny */
  .price-big { font-size: 1.3rem; }

  /* Stats grid – 2 sloupce místo 4 */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Tenant dashboard grid */
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-4 { grid-template-columns: 1fr 1fr !important; }

  /* Tabulky – menší padding */
  .table th, .table td { padding: 8px 10px; font-size: 0.82rem; }

  /* Topbar – schrovat jméno uživatele */
  .nav-user-name { display: none; }

  /* Stránkování v adminu */
  .admin-content { padding: 20px 16px; }

  /* Login box */
  .login-box { padding: 28px 20px; }

  /* Nadpisy */
  .ptitle, .page-title { font-size: 1.3rem; }
}
