@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --navy: #14264F;
  --navy-2: #1E3A6E;
  --steel: #2E6BA8;
  --cyan: #17B0C4;
  --amber: #F0A526;
  --green: #21A179;
  --red: #D9534F;

  --bg: #F4F7FB;
  --card: #FFFFFF;
  --text: #16233D;
  --text-2: #4A5878;
  --gray: #7C8AA6;
  --border: #DDE5F0;

  --shadow: 0 2px 4px rgba(20, 38, 79, .05), 0 8px 24px rgba(20, 38, 79, .07);
  --shadow-lg: 0 4px 8px rgba(20, 38, 79, .07), 0 16px 44px rgba(20, 38, 79, .12);
  --radius: 14px;

  --head: 'Manrope', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--head); line-height: 1.25; color: var(--navy); }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.18rem; font-weight: 700; }

a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }

/* ============================ NAVBAR ============================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(20, 38, 79, .06);
}
.nav-in {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 8px; min-height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--head); font-weight: 800; font-size: 1.28rem;
  color: var(--navy); margin-right: auto; text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 48px; height: 48px; flex: none; display: block; border-radius: 50%;
  background: #fff; padding: 2px; border: 1px solid var(--border);
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a, .dd-btn {
  display: block; padding: 9px 13px; border-radius: 9px;
  color: var(--text-2); font-size: .93rem; font-weight: 500;
  font-family: var(--body); background: none; border: 0; cursor: pointer;
  white-space: nowrap;
}
.nav-links a:hover, .dd-btn:hover { background: var(--bg); color: var(--navy); text-decoration: none; }
.nav-links a.active { background: var(--steel); color: #fff; }

.dropdown { position: relative; }
.dd-btn::after { content: '▾'; margin-left: 5px; opacity: .7; font-size: .8em; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 236px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown-menu.open, .dropdown:hover > .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--text); font-size: .92rem;
}
.dropdown-menu a:hover { background: var(--bg); color: var(--navy); text-decoration: none; }

.nav-user {
  display: flex; align-items: center; gap: 8px; margin-left: 8px;
  padding-left: 12px; border-left: 1px solid var(--border);
}
.nav-user span { color: var(--text); font-size: .88rem; font-weight: 600; }

.burger { display: none; background: none; border: 0; color: var(--navy); font-size: 1.5rem; cursor: pointer; padding: 4px 8px; }

@media (max-width: 980px) {
  .burger { display: block; }
  .nav-links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; padding: 8px 12px 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(20, 38, 79, .12);
  }
  .nav-links.open { display: flex; }
  .dropdown-menu { position: static; display: none; box-shadow: none; margin: 4px 0 4px 12px; }
  .dropdown:hover > .dropdown-menu { display: none; }
  .dropdown-menu.open { display: block; }
  .nav-user { border-left: 0; padding-left: 0; margin: 8px 0 0; }
}

/* ============================ BUTTONS ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; border: 0; cursor: pointer;
  font-family: var(--head); font-weight: 700; font-size: .95rem;
  background: var(--steel); color: #fff; text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { background: var(--navy-2); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-amber { background: var(--amber); color: #3A2A05; }
.btn-amber:hover { background: #DD9518; }
.btn-green { background: var(--green); }
.btn-green:hover { background: #1A8965; }
.btn-ghost { background: transparent; color: var(--steel); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: #fff; border-color: var(--steel); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 7px 14px; font-size: .86rem; }

/* ============================ CARDS ============================ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; font-family: var(--head);
  background: #E8F0FA; color: var(--steel);
}
.badge-a2 { background: #E4F6F0; color: var(--green); }
.badge-b1 { background: #FDF0DC; color: #B5760C; }
.badge-b2 { background: #EDE7FB; color: #6C4BC4; }
.badge-ok { background: #E4F6F0; color: var(--green); }
.badge-wait { background: #FDF0DC; color: #B5760C; }

/* ============================ FORMS ============================ */
.field { margin-bottom: 16px; }
.field label {
  display: block; margin-bottom: 6px;
  font-family: var(--head); font-weight: 600; font-size: .9rem; color: var(--text-2);
}
input[type=text], input[type=tel], input[type=password], select, textarea {
  width: 100%; padding: 11px 14px; font-family: var(--body); font-size: 1rem;
  color: var(--text); background: #fff;
  border: 1.5px solid var(--border); border-radius: 10px; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--steel); box-shadow: 0 0 0 3px rgba(46, 107, 168, .13);
}
textarea { resize: vertical; min-height: 190px; line-height: 1.7; }

.alert { padding: 12px 16px; border-radius: 10px; font-size: .93rem; margin-bottom: 16px; }
.alert-err { background: #FDECEC; color: #A03430; border: 1px solid #F5C9C7; }
.alert-ok { background: #E4F6F0; color: #14735A; border: 1px solid #B9E4D6; }
.alert-info { background: #E8F0FA; color: #1E4E7E; border: 1px solid #C6DAF0; }
.alert-warn { background: #FDF4E3; color: #8A5C08; border: 1px solid #F2DDB4; }

/* ============================ MISC ============================ */
.page { padding: 34px 0 64px; }
.page-head { margin-bottom: 26px; }
.page-head p { color: var(--text-2); margin-top: 6px; }
.muted { color: var(--gray); font-size: .9rem; }
.center { text-align: center; }
.mt { margin-top: 18px; } .mb { margin-bottom: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-family: var(--head); font-weight: 700; color: var(--text-2); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
tbody tr:hover { background: var(--bg); }

.footer {
  background: var(--navy); color: #A8BBD8; padding: 38px 0 26px; margin-top: 60px;
  font-size: .9rem;
}
.footer a { color: #CFE0F5; }
.foot-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px;
  padding-bottom: 22px; border-bottom: 1px solid rgba(255, 255, 255, .13);
}
.foot-grid > div > a { display: block; padding: 3px 0; }
.foot-brand {
  font-family: var(--head); font-weight: 800; font-size: 1.2rem;
  color: #fff; margin-bottom: 4px;
}
.foot-brand span { color: var(--cyan); }
.foot-h {
  font-family: var(--head); font-weight: 700; color: #fff;
  font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px;
}
.foot-bottom { padding-top: 18px; font-size: .85rem; }
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; gap: 20px; } }

/* ============================ INTERAKTIV TOPSHIRIQ MATNI ============================ */
.task-text .rline { min-height: 1.3em; }
.task-text .rline:empty::before { content: '\00a0'; }
.rblank {
  display: inline-block; padding: 2px 6px; margin: 0 2px; vertical-align: baseline;
  border: 0; border-bottom: 2px solid var(--steel); background: #EFF5FC;
  border-radius: 4px 4px 0 0; font-family: var(--body); font-size: .95rem;
  color: var(--navy); font-weight: 600;
}
.rblank:focus { outline: none; background: #E0EEFB; border-bottom-color: var(--navy); }
.rblank.filled { background: #E4F6F0; border-bottom-color: var(--green); }
.rblank:disabled { opacity: .7; background: var(--bg); }

.mcq-block {
  display: flex; flex-direction: column; gap: 5px; margin: 8px 0 14px;
  padding: 10px 12px; background: #fff; border: 1.5px solid var(--border); border-radius: 10px;
}
.mcq-opt {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  padding: 6px 8px; border-radius: 7px; font-size: .95rem;
}
.mcq-opt:hover { background: var(--bg); }
.mcq-opt.selected { background: #E4F6F0; }
.mcq-opt input[type=radio] { margin-top: 4px; accent-color: var(--steel); flex: none; }
.mcq-opt:has(input:disabled) { cursor: default; }

.r-fallback-lbl { font-family: var(--head); font-weight: 600; font-size: .9rem; color: var(--navy); margin: 16px 0 6px; }

/* ============================ OVOZ YOZISH ============================ */
.rec-box {
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 16px; background: #FAFCFF;
}
.rec-row { display: flex; align-items: center; gap: 14px; }
.rec-btn {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  border: 0; cursor: pointer; background: var(--red);
  display: grid; place-items: center;
  transition: background .15s ease, transform .12s ease;
}
.rec-btn:hover { transform: scale(1.06); }
.rec-btn .rec-dot { width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: all .18s ease; }
.rec-btn.on { background: var(--navy); animation: recpulse 1.4s ease-in-out infinite; }
.rec-btn.on .rec-dot { width: 16px; height: 16px; border-radius: 3px; }
@keyframes recpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, .45); }
  50%      { box-shadow: 0 0 0 12px rgba(217, 83, 79, 0); }
}
.rec-info { flex: 1; min-width: 0; }
.rec-vaqt {
  font-family: var(--head); font-weight: 800; font-size: 1.5rem;
  color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.rec-holat { color: var(--text-2); font-size: .87rem; }
.rec-audio { width: 100%; margin-top: 12px; }

.rec-wave { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-top: 12px; }
.rec-wave i {
  flex: 1; background: linear-gradient(180deg, var(--cyan), var(--steel));
  border-radius: 3px; animation: recwave .9s ease-in-out infinite;
}
.rec-wave i:nth-child(1) { animation-delay: 0s }
.rec-wave i:nth-child(2) { animation-delay: .12s }
.rec-wave i:nth-child(3) { animation-delay: .24s }
.rec-wave i:nth-child(4) { animation-delay: .36s }
.rec-wave i:nth-child(5) { animation-delay: .48s }
.rec-wave i:nth-child(6) { animation-delay: .60s }
.rec-wave i:nth-child(7) { animation-delay: .72s }
@keyframes recwave { 0%, 100% { height: 22% } 50% { height: 100% } }

.spinner {
  width: 34px; height: 34px; margin: 30px auto; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--steel);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
