/* ═══════════════════════════════════════════════════════════════
   MA'NAVIY JAMOA — Asosiy dizayn tizimi
   Rang sxemasi: To'q ko'k (#0D2347) + Oltin (#C9910A)
   Uslub: Milliy islomiy geometrik naqshlar
═══════════════════════════════════════════════════════════════ */

:root {
  --navy:        #0D2347;
  --navy2:       #1A3C6B;
  --navy3:       #0A1A35;
  --gold:        #C9910A;
  --gold-light:  #F0C040;
  --gold-pale:   #FDF6E3;
  --gold-border: rgba(201,145,10,.35);
  --cream:       #FEFAF2;
  --white:       #FFFFFF;
  --bg:          #F4F6FB;
  --card-bg:     #FFFFFF;
  --text:        #1F2937;
  --muted:       #6B7280;
  --border:      #E5E0D0;
  --success:     #10B981;
  --success-bg:  #D1FAE5;
  --danger:      #EF4444;
  --danger-bg:   #FEE2E2;
  --warning:     #F59E0B;
  --shadow-sm:   0 2px 8px rgba(13,35,71,.08);
  --shadow-md:   0 4px 20px rgba(13,35,71,.12);
  --shadow-lg:   0 8px 40px rgba(13,35,71,.16);
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   18px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; line-height: 1.6;
  font-size: 15px;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* ── NAVBAR ── */
.navbar {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  padding: .85rem 1.5rem;
  display: flex; align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,.25);
}
.navbar-brand {
  display: flex; align-items: center; gap: .6rem;
  font-size: 17px; font-weight: 800;
  color: var(--white); text-decoration: none;
  letter-spacing: .3px;
}
.navbar-brand .brand-icon {
  width: 36px; height: 36px;
  background: rgba(201,145,10,.15);
  border: 1.5px solid rgba(201,145,10,.5);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
}
.navbar-brand .brand-name-gold { color: var(--gold-light); }
.navbar-user {
  font-size: 13px; color: rgba(255,255,255,.7);
  display: flex; align-items: center; gap: .75rem;
}
.navbar-user .user-name {
  color: var(--gold-light); font-weight: 600;
}

/* ── CONTAINER ── */
.container {
  max-width: 960px; margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ── CARD ── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.card-flat {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.card-navy {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--gold);
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.card-gold {
  background: var(--gold-pale);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--gold);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* ── DIVIDER ── */
.divider {
  display: flex; align-items: center; gap: .5rem;
  margin: 1rem 0;
}
.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-diamond {
  width: 8px; height: 8px;
  background: var(--gold); transform: rotate(45deg); flex-shrink: 0;
}
.divider-text {
  font-size: 12px; color: var(--muted);
  font-weight: 600; letter-spacing: .5px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.4rem; border-radius: var(--radius-md);
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  font-family: inherit; transition: .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, #E8AA20 50%, var(--gold) 100%);
  color: var(--navy3);
  font-weight: 800;
}
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-outline  {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline-gold {
  background: transparent;
  border: 1.5px solid var(--gold-border);
  color: var(--gold);
}
.btn-lg { padding: .8rem 2rem; font-size: 15px; }
.btn-sm { padding: .4rem .85rem; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ── FORM ── */
.input {
  width: 100%; padding: .7rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit;
  background: var(--cream); color: var(--text);
  outline: none; transition: .2s;
}
.input:focus {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(201,145,10,.1);
}
.input::placeholder { color: #9CA3AF; }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 100px; }

.label {
  display: block; font-size: 13px;
  font-weight: 600; color: var(--navy2);
  margin-bottom: .35rem;
  letter-spacing: .2px;
}
.field { margin-bottom: .85rem; }

/* ── ALERT ── */
.alert {
  padding: .8rem 1.1rem; border-radius: var(--radius-md);
  font-size: 13px; margin-bottom: .85rem;
  display: flex; align-items: flex-start; gap: .5rem;
}
.alert.hidden { display: none !important; }
.alert-success {
  background: var(--success-bg);
  border: 1px solid #6EE7B7; color: #065F46;
}
.alert-error {
  background: var(--danger-bg);
  border: 1px solid #FCA5A5; color: #991B1B;
}
.alert-info {
  background: #DBEAFE;
  border: 1px solid #BFDBFE; color: #1D4ED8;
}
.alert-warning {
  background: #FEF3C7;
  border: 1px solid #FDE68A; color: #92580A;
}

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .7rem; border-radius: 20px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
.badge-gold    { background: var(--gold-pale); color: var(--gold); border: 1px solid #E8D5A0; }
.badge-navy    { background: #EBF3FB; color: var(--navy2); }
.badge-green   { background: var(--success-bg); color: #065F46; }
.badge-red     { background: var(--danger-bg); color: #991B1B; }
.badge-gray    { background: #F3F4F6; color: #4B5563; }
.badge-warning { background: #FEF3C7; color: #92580A; }

/* ── PROGRESS ── */
.progress-bar {
  height: 8px; background: #E5E7EB;
  border-radius: 99px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  transition: width .5s ease;
}
.progress-fill-green {
  background: linear-gradient(90deg, var(--success) 0%, #34D399 100%);
}

/* ── GRID ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }

/* ── MODULE CARD ── */
.module-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  cursor: pointer; transition: .2s;
  position: relative; overflow: hidden;
}
.module-card::before {
  content: ''; position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--gold); border-radius: 4px 0 0 4px;
}
.module-card:hover:not(.locked) {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.module-card.done {
  border-color: var(--success);
  background: #F0FDF4;
}
.module-card.done::before { background: var(--success); }
.module-card.active-module {
  border-color: var(--gold);
  background: var(--gold-pale);
}
.module-card.locked {
  opacity: .55; cursor: not-allowed;
}
.module-card.locked::before { background: #D1D5DB; }
.module-card:hover:not(.locked) { cursor: pointer; }

/* ── SECTION TITLE ── */
.section-title {
  font-size: 13px; font-weight: 800;
  color: var(--gold); letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: .85rem;
  display: flex; align-items: center; gap: .5rem;
}
.section-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--gold-border), transparent);
}

/* ── STAT CARD ── */
.stat-card {
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 1.1rem; text-align: center;
  border-bottom: 3px solid var(--gold);
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 30px; font-weight: 900;
  color: var(--gold-light);
  line-height: 1.1;
}
.stat-label {
  font-size: 12px; color: rgba(255,255,255,.6);
  margin-top: .3rem; font-weight: 500;
}

/* ── TAB BAR ── */
.tab-bar {
  display: flex; gap: .3rem;
  margin-bottom: 1.2rem;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: .3rem;
  border: 1px solid var(--border);
}
.tab {
  flex: 1; padding: .55rem .8rem;
  cursor: pointer; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--muted); transition: .2s;
  text-align: center; user-select: none;
}
.tab:hover { color: var(--navy2); background: rgba(201,145,10,.08); }
.tab.active {
  background: var(--navy);
  color: var(--gold-light);
  box-shadow: var(--shadow-sm);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── ANSWER BUTTONS ── */
.answer-btn {
  display: block; width: 100%;
  text-align: left; padding: .8rem 1.1rem;
  margin-bottom: .5rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  cursor: pointer; font-size: 14px;
  font-family: inherit; transition: .2s;
  color: var(--text);
}
.answer-btn:hover {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--navy);
}
.answer-btn.selected {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: var(--navy); font-weight: 600;
}
.answer-btn.correct {
  border-color: var(--success);
  background: var(--success-bg);
  color: #065F46;
}
.answer-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: #991B1B;
}

/* ── RESULT BOX ── */
.result-box { text-align: center; padding: 2.5rem 1.5rem; }
.result-score {
  font-size: 64px; font-weight: 900;
  color: var(--navy); line-height: 1;
  margin-bottom: .3rem;
}
.result-score.passed { color: var(--success); }
.result-score.failed { color: var(--danger); }
.result-label { font-size: 18px; color: var(--muted); margin-bottom: 1rem; }

/* ── CERTIFICATE ── */
.cert-preview {
  border: 3px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--gold-pale) 0%, var(--white) 60%);
  position: relative; overflow: hidden;
}
.cert-preview::before {
  content: '';
  position: absolute; inset: 8px;
  border: 1px solid rgba(201,145,10,.25);
  border-radius: calc(var(--radius-xl) - 6px);
  pointer-events: none;
}
.cert-corner {
  position: absolute; width: 50px; height: 50px;
  border: 2.5px solid var(--gold); opacity: .4;
}
.cert-corner.tl { top:10px; left:10px; border-right:none; border-bottom:none; border-radius:6px 0 0 0; }
.cert-corner.tr { top:10px; right:10px; border-left:none; border-bottom:none; border-radius:0 6px 0 0; }
.cert-corner.bl { bottom:10px; left:10px; border-right:none; border-top:none; border-radius:0 0 0 6px; }
.cert-corner.br { bottom:10px; right:10px; border-left:none; border-top:none; border-radius:0 0 6px 0; }

/* ── TABLE ── */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: var(--navy); color: var(--white);
  padding: .7rem 1rem; text-align: left; font-weight: 600;
}
.table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.table th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gold-pale); }

/* ── INFO BOX ── */
.info-box {
  background: var(--gold-pale);
  border: 1.5px solid var(--gold-border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  font-size: 13px; color: var(--navy2);
  margin-bottom: .85rem;
}
.warning-box {
  background: #FEF3C7;
  border: 1.5px solid #FDE68A;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md);
  padding: .85rem 1rem;
  font-size: 13px; color: #92580A;
  margin-bottom: .85rem;
}

/* ── LECTURE TEXT ── */
.lecture-text { line-height: 1.85; font-size: 15px; color: var(--text); }
.lecture-text h2 {
  font-size: 19px; color: var(--navy);
  margin: 1.5rem 0 .6rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--gold-border);
}
.lecture-text h3 {
  font-size: 16px; color: var(--navy2);
  margin: 1.1rem 0 .4rem;
}
.lecture-text p  { margin-bottom: .85rem; }
.lecture-text ul, .lecture-text ol {
  margin-left: 1.5rem; margin-bottom: .85rem;
}
.lecture-text li { margin-bottom: .35rem; }
.lecture-text strong { color: var(--navy); }
.lecture-text blockquote {
  border-left: 4px solid var(--gold);
  padding: .75rem 1rem;
  background: var(--gold-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0; color: var(--navy2);
  font-style: italic;
}

/* ── STEP INDICATOR ── */
.step-indicator {
  display: flex; align-items: center;
  justify-content: center; gap: .4rem;
  margin-bottom: 1.5rem;
}
.step-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border);
  background: var(--card-bg); color: var(--muted);
  transition: .3s;
}
.step-dot.active {
  background: var(--navy); color: var(--gold-light);
  border-color: var(--navy);
}
.step-dot.done {
  background: var(--success); color: #fff;
  border-color: var(--success);
}
.step-line { height: 2px; width: 44px; background: var(--border); transition: .3s; }
.step-line.done { background: var(--success); }

/* ── PSYCHO TEST ── */
.psycho-progress {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  border-bottom: 3px solid var(--gold);
}
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

/* ── HIDDEN ── */
.hidden { display: none !important; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--gold-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── PRINT ── */
@media print {
  .navbar, .btn, .tab-bar { display: none !important; }
  .cert-preview { border: 3px solid var(--gold) !important; }
}

/* ── MOBILE ── */
@media (max-width: 640px) {
  .container { padding: 1rem .75rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .navbar { padding: .7rem 1rem; }
  .navbar-brand { font-size: 15px; }
  .card, .card-flat { padding: 1.1rem; }
  .tab { font-size: 12px; padding: .45rem .5rem; }
  .result-score { font-size: 48px; }
  .cert-preview { padding: 1.5rem 1rem; }
}

@media (max-width: 400px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-num { font-size: 24px; }
}
