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

:root {
  --navy:        #1B2B6B;
  --navy-light:  #2a3f8f;
  --navy-dark:   #0f1d4d;
  --teal:        #2ABFAB;
  --teal-light:  #4fd4c2;
  --teal-dark:   #1e9c8a;
  --yellow:      #F5A623;
  --yellow-light:#ffc559;
  --purple:      #8B5CF6;
  --purple-light:#a78bfa;
  --white:       #ffffff;
  --bg:          #f4f6fb;
  --bg2:         #eaecf5;
  --text:        #1a2340;
  --text-2:      #4a5480;
  --gray:        #6b7a99;
  --border:      rgba(27,43,107,0.12);
  --border2:     #dde3f0;
  --success:     #22c55e;
  --danger:      #ef4444;
  --shadow:      0 4px 24px rgba(27,43,107,0.10);
  --shadow-lg:   0 12px 40px rgba(27,43,107,0.14);
  --radius:      14px;
  --radius-lg:   20px;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { overflow-x:hidden; -webkit-text-size-adjust:100%; scroll-behavior:smooth; font-size:17.5px; }
img, video, iframe { max-width:100%; }
body {
  font-family:'Outfit', sans-serif;
  font-size:1rem;
  line-height:1.65;
  background:var(--bg); color:var(--text);
  min-height:100vh; display:flex; flex-direction:column; overflow-x:hidden;
}

/* ===== HEADER ===== */
header {
  background:rgba(255,255,255,0.97);
  backdrop-filter:blur(14px);
  border-bottom:2px solid rgba(42,191,171,0.18);
  padding:0 2rem;
  padding-top:env(safe-area-inset-top);
  position:sticky; top:0; z-index:100;
  box-shadow:0 4px 24px rgba(27,43,107,0.08);
  overflow:visible;
}
.header-inner {
  max-width:1400px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between;
  height:80px; gap:0.75rem;
  flex-wrap:nowrap;
}
.logo { display:flex; align-items:center; gap:10px; text-decoration:none; flex-shrink:0; }
.logo img {
  width:56px; height:56px; object-fit:contain; border-radius:14px;
  box-shadow:0 4px 14px rgba(27,43,107,0.16);
}
.logo-text {
  font-family:'Nunito', sans-serif; font-size:1.3rem; font-weight:900;
  color:var(--navy); line-height:1.1; white-space:nowrap;
}
.logo-text span { color:var(--teal); }
.logo-sub { display:block; font-size:0.72rem; font-weight:600; color:var(--text-2); margin-top:2px; letter-spacing:0.03em; white-space:nowrap; }

/* Desktop nav */
.header-nav {
  display:flex; gap:0.1rem; align-items:center;
  flex:1; justify-content:center;
  flex-wrap:nowrap; overflow:visible;
}
.header-nav > a,
.header-nav > .dropdown > a {
  color:var(--navy); text-decoration:none;
  font-size:1rem; font-weight:700; letter-spacing:0.01em;
  padding:0.5rem 0.85rem; border-radius:9px;
  transition:color 0.18s, background 0.18s;
  cursor:pointer; white-space:nowrap;
  display:inline-flex; align-items:center; gap:5px;
  flex-shrink:0;
}
.header-nav > a:hover,
.header-nav > .dropdown > a:hover {
  color:var(--teal); background:rgba(42,191,171,0.08);
}
.header-nav > a.active,
.header-nav > .dropdown > a.active {
  color:var(--navy); font-weight:800;
  background:linear-gradient(135deg,rgba(42,191,171,0.15),rgba(27,43,107,0.06));
  box-shadow:inset 0 0 0 1.5px rgba(42,191,171,0.35);
}

/* Hamburger */
.hamburger {
  display:none; flex-direction:column; gap:5px; cursor:pointer;
  padding:10px; border-radius:10px; transition:background 0.18s;
  min-width:44px; min-height:44px; align-items:center; justify-content:center;
  -webkit-tap-highlight-color:transparent; flex-shrink:0;
}
.hamburger:hover { background:rgba(42,191,171,0.1); }
.hamburger span {
  display:block; width:24px; height:2.5px;
  background:var(--navy); border-radius:2px; transition:all 0.3s;
}

/* Mobile menu */
.mobile-menu {
  display:none; flex-direction:column;
  background:var(--white); border-top:1px solid var(--border2);
  padding:1rem 1.25rem 1.25rem;
  box-shadow:0 8px 24px rgba(27,43,107,0.12);
  max-height:0; overflow:hidden; transition:max-height 0.35s ease;
}
.mobile-menu.open { display:flex; max-height:100vh; }
.mobile-menu > a {
  padding:0.85rem 1rem; border-radius:10px; font-weight:700;
  color:var(--navy); text-decoration:none; font-size:1.05rem;
  display:flex; align-items:center; gap:0.6rem;
  transition:background 0.15s, color 0.15s;
}
.mobile-menu > a:hover, .mobile-menu > a.active { background:rgba(42,191,171,0.1); color:var(--teal); }
.mobile-section-label {
  font-size:0.8rem; font-weight:800; color:var(--gray); letter-spacing:0.08em;
  text-transform:uppercase; padding:0.85rem 1rem 0.3rem;
}

/* Login button */
.btn-login {
  background:linear-gradient(135deg,var(--navy),var(--navy-light)) !important;
  color:var(--white) !important; padding:9px 18px !important;
  border-radius:10px; font-size:0.9rem !important; font-weight:800 !important;
  box-shadow:0 4px 14px rgba(27,43,107,0.24); white-space:nowrap; flex-shrink:0;
  transition:transform 0.18s, box-shadow 0.18s;
}
.btn-login:hover { transform:translateY(-1px); box-shadow:0 6px 18px rgba(27,43,107,0.3) !important; }

/* Nav user block */
.nav-user {
  display:flex; align-items:center; gap:0.55rem; flex-shrink:0;
  padding:0.35rem 0.55rem;
  background:linear-gradient(135deg,rgba(27,43,107,0.04),rgba(42,191,171,0.06));
  border:1.5px solid rgba(42,191,171,0.25); border-radius:12px;
  max-width:280px;
}
.nav-user-avatar {
  width:36px; height:36px; border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--navy),var(--teal));
  color:white; font-size:0.88rem; font-weight:900;
  display:flex; align-items:center; justify-content:center;
  font-family:'Nunito', sans-serif;
}
.nav-user-info { min-width:0; }
.nav-user-name {
  font-size:0.88rem; font-weight:800; color:var(--navy);
  white-space:nowrap; max-width:130px; overflow:hidden; text-overflow:ellipsis; line-height:1.25;
}
.nav-user-group { font-size:0.82rem; color:var(--teal-dark); font-weight:700; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:130px; }
.btn-nav-logout {
  background:var(--white); border:1.5px solid var(--border);
  color:var(--navy); padding:0.35rem 0.75rem; border-radius:8px;
  font-size:0.85rem; font-weight:700; cursor:pointer;
  font-family:'Outfit', sans-serif; transition:all 0.18s; white-space:nowrap; flex-shrink:0;
}
.btn-nav-logout:hover { background:var(--danger); border-color:var(--danger); color:white; }

/* Dropdown */
.dropdown { position:relative; }
.dropdown-menu {
  display:none; position:absolute; top:calc(100% + 8px); left:0;
  background:var(--white); border-radius:var(--radius-lg);
  box-shadow:0 12px 40px rgba(27,43,107,0.14);
  border:1px solid rgba(42,191,171,0.2); min-width:280px; z-index:9999;
  overflow:hidden; animation:dropIn 0.15s ease;
}
@keyframes dropIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }
.dropdown-menu.open { display:block; }
.dropdown-menu a {
  display:flex; align-items:center; gap:0.7rem;
  padding:1rem 1.25rem; color:var(--navy); text-decoration:none;
  font-size:1.05rem; font-weight:700;
  border-bottom:1px solid rgba(27,43,107,0.05); transition:background 0.15s;
}
.dropdown-menu a:last-child { border-bottom:none; }
.dropdown-menu a:hover { background:rgba(42,191,171,0.08); color:var(--teal-dark); }
.dropdown-menu a.active { background:rgba(42,191,171,0.12); font-weight:800; }

/* ===== SVG ICONS ===== */
.ico-svg { display:inline-block; vertical-align:middle; flex-shrink:0; }
.ico-wrap { display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.ico-wrap--info { color:var(--navy); }
.ico-wrap--warn { color:var(--yellow); }
.dm-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; flex-shrink:0;
  background:rgba(42,191,171,0.1); border-radius:9px;
}
.dm-icon .ico-svg { stroke:var(--teal-dark); }
.page-header h1.has-ico, .page-header h1 { display:flex; align-items:center; justify-content:center; gap:0.7rem; flex-wrap:wrap; }
.page-header h1 .ico-svg { stroke:var(--teal-light); flex-shrink:0; }
.header-nav > a.has-ico { display:inline-flex; align-items:center; gap:0.45rem; }
.header-nav > a.has-ico .ico-svg { stroke:var(--navy); }
.mobile-menu > a.has-ico { display:flex; align-items:center; gap:0.55rem; }
.mobile-menu > a.has-ico .ico-svg { stroke:var(--teal-light); }
.footer-logo.has-ico { display:inline-flex; align-items:center; justify-content:center; gap:0.5rem; }
.stage-icon .ico-svg, .feature-icon .ico-svg { stroke:var(--navy); }
.author-avatar, .author-page-avatar { display:flex; align-items:center; justify-content:center; }
.author-avatar .ico-svg, .author-page-avatar .ico-svg { stroke:var(--navy); }
.exercise-card h3.has-ico { display:flex; align-items:center; gap:0.5rem; }
.field label.has-ico { display:flex; align-items:center; gap:0.4rem; }
.dropdown > a .ico-svg { stroke:var(--gray); margin-left:2px; vertical-align:-2px; }

/* ===== PAGE HEADER ===== */
.page-header {
  background:linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 60%, #1e6b8a 100%);
  color:white; padding:3rem 2rem 2.5rem; text-align:center; position:relative; overflow:hidden;
}
.page-header::before {
  content:''; position:absolute; inset:0;
  background:radial-gradient(ellipse at 70% 50%, rgba(42,191,171,0.2) 0%, transparent 60%);
}
.page-header h1 { font-family:'Nunito',sans-serif; font-size:clamp(1.7rem,4vw,2.5rem); font-weight:900; position:relative; color:white; }
.page-header p { color:rgba(255,255,255,0.82); font-size:1.1rem; margin-top:0.5rem; position:relative; }

/* ===== MAIN ===== */
.main { flex:1; padding:2rem max(1.5rem, env(safe-area-inset-left)); max-width:1320px; margin:0 auto; width:100%; }

/* ===== SECTIONS ===== */
section { padding:5rem 2rem; }
.section-inner { max-width:1200px; margin:0 auto; }
.section-header { text-align:center; margin-bottom:3rem; }
.section-tag {
  display:inline-block; background:rgba(42,191,171,0.12);
  color:var(--teal-dark); font-size:0.85rem; font-weight:800;
  padding:0.4rem 1.1rem; border-radius:20px; letter-spacing:0.08em;
  text-transform:uppercase; margin-bottom:0.75rem;
  border:1px solid rgba(42,191,171,0.25);
}
.section-title { font-family:'Nunito',sans-serif; font-size:clamp(1.9rem,4vw,2.7rem); font-weight:900; color:var(--navy); margin-bottom:0.75rem; }
.section-desc { color:var(--text-2); font-size:1.05rem; max-width:600px; margin:0 auto; line-height:1.7; }

/* ===== BUTTONS ===== */
.btn-primary {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background:linear-gradient(135deg,var(--teal),var(--teal-dark));
  color:white; padding:0.9rem 2rem; border-radius:12px;
  font-weight:800; font-size:1rem; text-decoration:none;
  box-shadow:0 6px 20px rgba(42,191,171,0.35);
  transition:transform 0.18s, box-shadow 0.18s; cursor:pointer; border:none;
  font-family:'Outfit',sans-serif; -webkit-tap-highlight-color:transparent;
}
.btn-primary:hover { transform:translateY(-2px); box-shadow:0 10px 28px rgba(42,191,171,0.4); color:white; }

.btn-secondary {
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background:transparent; color:var(--navy);
  padding:0.9rem 2rem; border-radius:12px;
  font-weight:800; font-size:1rem; text-decoration:none;
  border:2px solid rgba(27,43,107,0.25);
  transition:all 0.18s; cursor:pointer; font-family:'Outfit',sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.btn-secondary:hover { background:var(--navy); color:white; border-color:var(--navy); }

.btn-submit {
  background:linear-gradient(135deg,var(--navy),var(--navy-light));
  color:white; padding:0.9rem 2rem; border-radius:12px;
  font-weight:800; font-size:1.05rem; border:none; cursor:pointer;
  width:100%; font-family:'Outfit',sans-serif; transition:all 0.18s;
  box-shadow:0 6px 20px rgba(27,43,107,0.25); min-height:52px;
}
.btn-submit:hover { transform:translateY(-2px); box-shadow:0 10px 28px rgba(27,43,107,0.3); }
.btn-submit:disabled { opacity:0.6; cursor:not-allowed; transform:none; }

/* ===== STAGE / FEATURE CARDS ===== */
.stages-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:1.5rem; }
.stage-card {
  background:white; border-radius:var(--radius-lg); padding:2rem;
  box-shadow:var(--shadow); border:1px solid var(--border2);
  transition:transform 0.22s, box-shadow 0.22s; text-decoration:none; color:inherit;
}
.stage-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.stage-card-top { display:flex; align-items:center; gap:1rem; margin-bottom:1.25rem; }
.stage-num {
  width:52px; height:52px; border-radius:14px; flex-shrink:0;
  background:linear-gradient(135deg,var(--navy),var(--teal));
  color:white; display:flex; align-items:center; justify-content:center;
  font-family:'Nunito',sans-serif; font-size:1.5rem; font-weight:900;
}
.stage-icon, .feature-icon {
  width:48px; height:48px; border-radius:12px;
  background:rgba(42,191,171,0.1);
  display:flex; align-items:center; justify-content:center; flex-shrink:0; font-size:1.5rem;
}
.stage-card h3 { font-family:'Nunito',sans-serif; font-size:1.2rem; font-weight:900; color:var(--navy); margin-bottom:0.6rem; }
.stage-card p { color:var(--text-2); font-size:1rem; line-height:1.65; }

/* ===== TOPIC CARDS ===== */
.topics-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:1rem; }
.topic-card {
  background:white; border-radius:var(--radius); padding:1.25rem 1.5rem;
  display:flex; align-items:center; gap:1rem;
  box-shadow:0 2px 12px rgba(27,43,107,0.07);
  border:1.5px solid var(--border2); text-decoration:none; color:var(--text);
  transition:border-color 0.18s, box-shadow 0.18s, transform 0.18s;
  cursor:pointer; -webkit-tap-highlight-color:transparent;
}
.topic-card:hover {
  border-color:var(--teal); box-shadow:0 6px 20px rgba(42,191,171,0.18);
  transform:translateY(-2px);
}
.topic-num {
  width:46px; height:46px; border-radius:12px; flex-shrink:0;
  background:linear-gradient(135deg,rgba(27,43,107,0.08),rgba(42,191,171,0.12));
  color:var(--navy); display:flex; align-items:center; justify-content:center;
  font-family:'Nunito',sans-serif; font-size:1.1rem; font-weight:900;
}
.topic-info h4 { font-size:1rem; font-weight:700; color:var(--navy); line-height:1.4; margin-bottom:2px; }
.topic-info p { font-size:0.93rem; color:var(--gray); }

/* ===== FILE LIST ===== */
.file-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:1rem; }
.file-item {
  background:white; border-radius:var(--radius); padding:1.25rem;
  display:flex; align-items:center; gap:1rem;
  box-shadow:0 2px 10px rgba(27,43,107,0.07);
  border:1.5px solid var(--border2);
  transition:border-color 0.18s, box-shadow 0.18s;
  cursor:pointer; -webkit-tap-highlight-color:transparent;
}
.file-item:hover { border-color:var(--teal); box-shadow:0 4px 16px rgba(42,191,171,0.15); }
.file-num {
  width:46px; height:46px; border-radius:12px; flex-shrink:0;
  background:linear-gradient(135deg,var(--teal),var(--teal-dark));
  color:white; display:flex; align-items:center; justify-content:center;
  font-family:'Nunito',sans-serif; font-size:1rem; font-weight:900;
}
.file-info { flex:1; min-width:0; }
.file-info h4 { font-size:1rem; font-weight:700; color:var(--navy); line-height:1.35; }
.file-info p { font-size:0.93rem; color:var(--gray); margin-top:2px; }
.file-badge {
  display:inline-block; background:rgba(42,191,171,0.1); color:var(--teal-dark);
  font-size:0.78rem; font-weight:800; padding:3px 9px; border-radius:6px;
  border:1px solid rgba(42,191,171,0.2); margin-top:4px; text-transform:uppercase; letter-spacing:0.05em;
}
.file-actions { display:flex; gap:0.5rem; margin-top:0.5rem; flex-wrap:wrap; }
.btn-view, .btn-dl {
  padding:0.5rem 1rem; border-radius:8px; font-size:0.9rem; font-weight:700;
  cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:5px;
  transition:all 0.15s; min-height:38px; border:none; font-family:'Outfit',sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.btn-view { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:white; }
.btn-view:hover { opacity:0.9; }
.btn-dl { background:rgba(42,191,171,0.1); color:var(--teal-dark); border:1px solid rgba(42,191,171,0.25); }
.btn-dl:hover { background:var(--teal); color:white; }

/* ===== FORMS / AUTH ===== */
.auth-wrap { flex:1; display:flex; align-items:center; justify-content:center; padding:2rem; min-height:60vh; }
.auth-card {
  background:white; border-radius:var(--radius-lg); padding:2.5rem 2.25rem;
  box-shadow:var(--shadow-lg); border:1px solid var(--border2);
  width:100%; max-width:460px;
}
.auth-card h2 { font-family:'Nunito',sans-serif; font-size:1.7rem; font-weight:900; color:var(--navy); margin-bottom:0.4rem; }
.auth-card p { color:var(--text-2); margin-bottom:1.75rem; font-size:1rem; line-height:1.65; }
.field { margin-bottom:1.25rem; }
.field label { display:block; font-size:0.95rem; font-weight:700; color:var(--navy); margin-bottom:0.4rem; }
.field input, .field select, .field textarea {
  width:100%; padding:0.9rem 1rem; border-radius:10px;
  border:1.5px solid var(--border2); background:var(--bg);
  font-size:1rem; font-family:'Outfit',sans-serif; color:var(--text);
  transition:border-color 0.18s, box-shadow 0.18s; outline:none;
  -webkit-appearance:none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color:var(--teal); box-shadow:0 0 0 3px rgba(42,191,171,0.15);
}
.field .hint { font-size:0.85rem; color:var(--gray); margin-top:0.3rem; }
.field .error { font-size:0.85rem; color:var(--danger); margin-top:0.3rem; display:none; }
.field.has-error input, .field.has-error select { border-color:var(--danger); }
.field.has-error .error { display:block; }
.auth-link { text-align:center; margin-top:1.25rem; font-size:0.97rem; color:var(--gray); }
.auth-link a { color:var(--teal-dark); font-weight:700; text-decoration:none; }
.auth-link a:hover { text-decoration:underline; }

/* ===== INFO / WARN BOX ===== */
.info-box {
  display:flex; gap:0.75rem; padding:1rem 1.25rem; border-radius:12px;
  background:rgba(27,43,107,0.05); border:1px solid rgba(27,43,107,0.12);
  font-size:1rem; line-height:1.65; margin:1rem 0;
}
.warn-box {
  display:flex; gap:0.75rem; padding:1rem 1.25rem; border-radius:12px;
  background:rgba(245,166,35,0.08); border:1px solid rgba(245,166,35,0.3);
  font-size:1rem; line-height:1.65; margin:1rem 0; color:var(--navy);
}

/* ===== MODAL (PDF) ===== */
.modal-overlay {
  display:none; position:fixed; inset:0; z-index:500;
  background:rgba(15,29,77,0.65); backdrop-filter:blur(4px);
  align-items:center; justify-content:center; padding:1rem;
}
.modal-overlay.open { display:flex; }
.modal {
  background:white; border-radius:var(--radius-lg); width:100%;
  max-width:1200px; max-height:95dvh; height:95dvh; display:flex; flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,0.3); overflow:hidden;
}
.modal-head {
  display:flex; align-items:center; justify-content:space-between;
  padding:1.1rem 1.5rem; border-bottom:1px solid var(--border2); flex-shrink:0;
}
.modal-head span { font-family:'Nunito',sans-serif; font-weight:800; font-size:1.1rem; color:var(--navy); }
.modal-head-actions { display:flex; gap:0.5rem; }
.modal-dl-btn {
  background:rgba(42,191,171,0.1); color:var(--teal-dark);
  border:1px solid rgba(42,191,171,0.25); padding:0.5rem 1rem;
  border-radius:8px; font-size:0.92rem; font-weight:700; text-decoration:none;
  display:inline-flex; align-items:center; gap:5px;
}
.modal-close {
  background:rgba(239,68,68,0.1); border:1px solid rgba(239,68,68,0.2);
  color:var(--danger); border-radius:8px; padding:0.45rem 0.65rem;
  cursor:pointer; font-size:1rem; line-height:1; display:flex; align-items:center; justify-content:center;
}
.modal-close:hover { background:var(--danger); color:white; }
.modal iframe { flex:1; border:none; min-height:0; width:100%; }

/* ===== TOAST ===== */
.toast {
  position:fixed; bottom:max(1.5rem, env(safe-area-inset-bottom)); left:50%;
  transform:translateX(-50%) translateY(80px); opacity:0;
  background:var(--navy); color:white; padding:0.9rem 1.5rem;
  border-radius:12px; font-size:1rem; font-weight:600;
  box-shadow:0 8px 24px rgba(27,43,107,0.25); z-index:600;
  transition:opacity 0.3s, transform 0.3s; max-width:90vw; text-align:center;
  pointer-events:none;
}
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.toast.success { background:var(--success); }
.toast.error { background:var(--danger); }

/* ===== AUTHOR ===== */
.author-card {
  display:grid; grid-template-columns:auto 1fr; gap:2rem; align-items:center;
  background:white; border-radius:var(--radius-lg); padding:2.5rem;
  box-shadow:var(--shadow); border:1px solid var(--border2);
}
.author-avatar {
  width:90px; height:90px; border-radius:20px;
  background:linear-gradient(135deg,var(--teal),var(--navy));
  overflow:hidden;
}
.author-avatar img { width:100%; height:100%; object-fit:cover; }
.author-name { font-family:'Nunito',sans-serif; font-size:1.4rem; font-weight:900; color:var(--navy); }
.author-title { color:var(--teal-dark); font-weight:700; font-size:1rem; margin:0.3rem 0 0.75rem; }
.author-bio { color:var(--text-2); font-size:1rem; line-height:1.65; }
.author-stats { display:flex; gap:1.5rem; margin-top:1rem; flex-wrap:wrap; }
.author-stat { text-align:center; }
.author-stat-num { font-family:'Nunito',sans-serif; font-size:1.45rem; font-weight:900; color:var(--teal-dark); }
.author-stat-label { font-size:0.82rem; color:var(--gray); font-weight:600; margin-top:1px; }

/* Author page */
.author-profile { max-width:860px; margin:0 auto; }
.author-profile-card { background:white; border-radius:24px; overflow:hidden; box-shadow:var(--shadow-lg); border:1px solid var(--border2); }
.author-profile-head {
  background:linear-gradient(135deg,var(--navy) 0%, var(--navy-light) 100%);
  padding:2.5rem 2rem; display:flex; align-items:center; gap:2rem; flex-wrap:wrap;
}
.author-page-avatar {
  width:120px; height:120px; border-radius:22px;
  background:linear-gradient(135deg,var(--teal),var(--teal-dark));
  overflow:hidden; box-shadow:0 0 0 6px rgba(42,191,171,0.25); flex-shrink:0;
}
.author-page-avatar img { width:100%; height:100%; object-fit:cover; }
.author-profile-name { font-family:'Nunito',sans-serif; font-size:1.6rem; font-weight:900; color:white; margin-bottom:0.4rem; }
.author-profile-title { color:var(--teal-light); font-weight:600; font-size:1rem; margin-bottom:0.75rem; }
.author-profile-tags { display:flex; flex-wrap:wrap; gap:0.5rem; }
.author-profile-tags span {
  background:rgba(255,255,255,0.12); color:rgba(255,255,255,0.9);
  font-size:0.82rem; font-weight:600; padding:0.35rem 0.85rem; border-radius:20px;
  border:1px solid rgba(255,255,255,0.15);
}
.author-profile-body { padding:2rem; }
.author-profile-section { margin-bottom:1.75rem; }
.author-profile-section h3 {
  font-family:'Nunito',sans-serif; font-size:1.1rem; font-weight:900;
  color:var(--navy); margin-bottom:0.85rem; display:flex; align-items:center; gap:0.5rem;
}
.author-profile-section h3::before { content:''; display:block; width:4px; height:20px; background:var(--teal); border-radius:2px; }
.author-profile-section p { color:var(--text-2); font-size:1rem; line-height:1.7; }
.author-profile-stats { display:grid; grid-template-columns:repeat(3, 1fr); gap:1rem; margin-top:1.25rem; }
.author-profile-stat {
  text-align:center; padding:1.25rem; border-radius:14px;
  background:linear-gradient(135deg,rgba(27,43,107,0.04),rgba(42,191,171,0.06));
  border:1px solid rgba(42,191,171,0.15);
}
.author-profile-stat-num { font-family:'Nunito',sans-serif; font-size:1.75rem; font-weight:900; color:var(--teal-dark); }
.author-profile-stat-label { font-size:0.85rem; color:var(--gray); font-weight:600; margin-top:3px; }

/* ===== HERO ===== */
.hero {
  background:linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, #1a4a6b 100%);
  padding:clamp(3rem, 7vw, 6rem) 2rem;
  position:relative; overflow:hidden; min-height:520px;
  display:flex; align-items:center;
}
.hero::before {
  content:''; position:absolute; inset:0;
  background:radial-gradient(ellipse at 75% 40%, rgba(42,191,171,0.25) 0%, transparent 55%),
             radial-gradient(ellipse at 20% 80%, rgba(139,92,246,0.15) 0%, transparent 45%);
}
.hero-pattern {
  position:absolute; inset:0; opacity:0.04;
  background-image:radial-gradient(circle, rgba(255,255,255,0.8) 1px, transparent 1px);
  background-size:40px 40px;
}
.hero-inner {
  max-width:1200px; width:100%; margin:0 auto;
  display:grid; grid-template-columns:1fr 1fr; gap:clamp(2rem, 5vw, 4rem);
  align-items:center; position:relative; z-index:1;
}
.hero-badge {
  display:inline-flex; align-items:center; gap:8px;
  background:rgba(42,191,171,0.15); border:1px solid rgba(42,191,171,0.4);
  border-radius:20px; padding:7px 18px; font-size:0.85rem; color:var(--teal-light);
  margin-bottom:1.5rem; letter-spacing:1.2px; text-transform:uppercase; font-weight:700;
}
.hero h1 {
  font-family:'Nunito',sans-serif; font-size:clamp(2rem, 5vw, 3.3rem);
  font-weight:900; line-height:1.15; margin-bottom:1.25rem; color:white;
}
.hero h1 span { color:var(--teal-light); }
.hero p { font-size:clamp(1rem, 2.5vw, 1.1rem); color:rgba(255,255,255,0.85); line-height:1.8; margin-bottom:2rem; }
.hero-btns { display:flex; gap:0.75rem; flex-wrap:wrap; }
.hero-btns .btn-primary, .hero-btns .btn-secondary { min-height:52px; }
.hero-btns .btn-secondary { border-color:rgba(255,255,255,0.3); color:white; }
.hero-btns .btn-secondary:hover { background:white; color:var(--navy); }
.hero-card {
  background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.15);
  border-radius:var(--radius-lg); padding:clamp(1.25rem, 3vw, 2rem); backdrop-filter:blur(10px);
}
.hero-card h3 { font-family:'Nunito',sans-serif; font-size:1.15rem; color:var(--teal-light); margin-bottom:1.25rem; text-align:center; font-weight:900; }
.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; margin-bottom:1.25rem; }
.stat-item {
  background:rgba(255,255,255,0.05); border:1px solid rgba(255,255,255,0.1);
  border-radius:12px; padding:0.9rem; text-align:center;
}
.stat-num { font-family:'Nunito',sans-serif; font-size:clamp(1.4rem, 4vw, 2rem); font-weight:900; color:var(--teal-light); }
.stat-label { font-size:0.82rem; color:rgba(255,255,255,0.55); margin-top:4px; }
.topic-list { display:flex; flex-direction:column; gap:0.5rem; }
.topic-item {
  font-size:0.9rem; color:rgba(255,255,255,0.8); padding:8px 12px;
  background:rgba(255,255,255,0.05); border-radius:8px; border-left:2px solid var(--teal);
  line-height:1.4;
}

/* ===== SINGLE PDF WRAP ===== */
.single-pdf-wrap iframe { width:100%; height:75dvh; border:none; border-radius:var(--radius); }

/* ===== FOOTER ===== */
footer {
  background:var(--navy-dark); color:rgba(255,255,255,0.65);
  text-align:center; padding:2rem 1.5rem;
  padding-bottom:max(2rem, env(safe-area-inset-bottom));
}
.footer-logo {
  font-family:'Nunito',sans-serif; font-size:1.25rem; font-weight:900;
  color:white; margin-bottom:0.5rem; display:inline-flex; align-items:center; gap:8px;
}
.footer-logo img { width:32px; height:32px; border-radius:8px; }
.footer-text { font-size:0.9rem; line-height:1.6; }
.footer-text a { color:var(--teal-light); text-decoration:none; }
.footer-text a:hover { text-decoration:underline; }

/* ===== VIDEO GRID ===== */
.video-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:1.5rem; }
.video-card {
  background:white; border-radius:var(--radius-lg); overflow:hidden;
  box-shadow:var(--shadow); border:1px solid var(--border2);
  transition:transform 0.22s, box-shadow 0.22s;
}
.video-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-lg); }
.video-thumb { position:relative; padding-top:56.25%; background:var(--bg2); overflow:hidden; }
.video-thumb iframe { position:absolute; inset:0; width:100%; height:100%; border:none; }
.video-info { padding:1.1rem 1.25rem; }
.video-info h4 { font-family:'Nunito',sans-serif; font-size:1.05rem; font-weight:800; color:var(--navy); line-height:1.4; }
.video-info p { font-size:0.9rem; color:var(--gray); margin-top:4px; }

/* ===== CROSSWORD ===== */
.crossword-grid-wrap { overflow:auto; -webkit-overflow-scrolling:touch; }
.crossword-img { max-width:100%; border-radius:var(--radius); box-shadow:var(--shadow); }

/* ===== TEST STYLES ===== */
.test-wrap { max-width:800px; margin:0 auto; }
.test-progress { background:var(--bg2); border-radius:8px; height:8px; margin-bottom:2rem; overflow:hidden; }
.test-progress-bar { height:100%; background:linear-gradient(90deg,var(--teal),var(--teal-dark)); border-radius:8px; transition:width 0.4s; }
.test-timer {
  display:inline-flex; align-items:center; gap:6px; font-family:'Nunito',sans-serif;
  font-size:1.25rem; font-weight:900; color:var(--navy); background:rgba(27,43,107,0.06);
  padding:0.5rem 1.25rem; border-radius:10px; border:1px solid var(--border);
}
.test-timer.urgent { color:var(--danger); background:rgba(239,68,68,0.08); border-color:rgba(239,68,68,0.25); animation:pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.7} }
.test-question-card {
  background:white; border-radius:var(--radius-lg); padding:2rem;
  box-shadow:var(--shadow); border:1px solid var(--border2); margin-bottom:1.5rem;
}
.test-q-num { font-size:0.9rem; color:var(--gray); font-weight:700; margin-bottom:0.75rem; text-transform:uppercase; letter-spacing:0.05em; }
.test-q-text { font-size:1.12rem; font-weight:600; color:var(--navy); line-height:1.65; margin-bottom:1.5rem; }
.test-q-img { max-width:100%; border-radius:10px; margin-bottom:1rem; }
.test-options { display:grid; gap:0.75rem; }
.test-option {
  display:flex; align-items:center; gap:1rem; padding:1rem 1.25rem;
  border-radius:12px; border:2px solid var(--border2);
  cursor:pointer; transition:all 0.18s; background:white;
  font-size:1.02rem; color:var(--navy); font-weight:600;
  -webkit-tap-highlight-color:transparent; text-align:left; width:100%;
  font-family:'Outfit',sans-serif;
}
.test-option:hover { border-color:var(--teal); background:rgba(42,191,171,0.05); }
.test-option.selected { border-color:var(--teal); background:rgba(42,191,171,0.1); color:var(--teal-dark); }
.test-option.correct { border-color:var(--success); background:rgba(34,197,94,0.1); color:#16a34a; }
.test-option.wrong { border-color:var(--danger); background:rgba(239,68,68,0.08); color:var(--danger); }
.option-letter {
  width:38px; height:38px; border-radius:10px; flex-shrink:0;
  background:rgba(27,43,107,0.07); display:flex; align-items:center; justify-content:center;
  font-family:'Nunito',sans-serif; font-weight:900; font-size:1rem; color:var(--navy);
}
.test-option.selected .option-letter { background:var(--teal); color:white; }
.test-result-card { background:white; border-radius:var(--radius-lg); padding:3rem 2rem; text-align:center; box-shadow:var(--shadow-lg); border:1px solid var(--border2); }
.test-result-score { font-family:'Nunito',sans-serif; font-size:4rem; font-weight:900; color:var(--teal-dark); line-height:1; }
.test-result-label { font-size:1.15rem; color:var(--text-2); margin:0.5rem 0 2rem; }
.test-result-detail { display:grid; grid-template-columns:repeat(3, 1fr); gap:1rem; margin-bottom:2rem; }
.test-result-item { padding:1rem; background:var(--bg); border-radius:12px; }
.test-result-item-num { font-family:'Nunito',sans-serif; font-size:1.5rem; font-weight:900; color:var(--navy); }
.test-result-item-label { font-size:0.88rem; color:var(--gray); font-weight:600; }

/* ===== MUSTAQIL ISH ===== */
.tasks-list { display:flex; flex-direction:column; gap:0.75rem; }
.task-item {
  background:white; border-radius:var(--radius); padding:1.1rem 1.35rem;
  display:flex; align-items:flex-start; gap:1rem;
  box-shadow:0 2px 8px rgba(27,43,107,0.06); border:1.5px solid var(--border2);
}
.task-num {
  width:36px; height:36px; border-radius:10px; flex-shrink:0;
  background:linear-gradient(135deg,var(--navy),var(--teal));
  color:white; display:flex; align-items:center; justify-content:center;
  font-family:'Nunito',sans-serif; font-size:0.88rem; font-weight:900;
}
.task-text { font-size:1.02rem; color:var(--text); line-height:1.65; padding-top:3px; }

/* ===== LEADERBOARD ===== */
.leaderboard-table { border-radius:var(--radius-lg); overflow:hidden; box-shadow:var(--shadow); }
.lb-header, .lb-row {
  display:grid; grid-template-columns:56px minmax(150px, 2fr) 1fr 1fr 1fr;
  align-items:center; padding:0.9rem 1.25rem; border-bottom:1px solid var(--border2);
}
.lb-header { background:linear-gradient(135deg,var(--navy),var(--navy-light)); color:white; font-size:0.9rem; font-weight:800; text-transform:uppercase; letter-spacing:0.05em; }
.lb-row { background:white; transition:background 0.15s; }
.lb-row:hover { background:rgba(42,191,171,0.05); }
.lb-row:last-child { border-bottom:none; }
.lb-rank { font-family:'Nunito',sans-serif; font-size:1.1rem; font-weight:900; color:var(--navy); }
.rank-1 .lb-rank { color:#f59e0b; }
.rank-2 .lb-rank { color:#9ca3af; }
.rank-3 .lb-rank { color:#92400e; }
.lb-name { font-weight:700; color:var(--navy); font-size:1rem; }
.lb-score { font-family:'Nunito',sans-serif; font-weight:900; color:var(--teal-dark); font-size:1rem; }
.lb-empty { padding:2rem; text-align:center; color:var(--gray); background:white; font-size:1rem; }

/* ===== TOUCH HELPERS ===== */
.btn-primary, .btn-secondary, .btn-submit, .btn-login, .btn-nav-logout,
.hamburger, .topic-card, .file-item, .test-option { -webkit-tap-highlight-color:transparent; }

/* ===== RESPONSIVE ===== */
@media (max-width:1280px) {
  .header-nav > a, .header-nav > .dropdown > a { padding:0.45rem 0.7rem; font-size:0.95rem; }
  .logo-text { font-size:1.2rem; }
  .nav-user-name { max-width:110px; }
}

@media (max-width:1100px) {
  .header-nav > a, .header-nav > .dropdown > a { padding:0.38rem 0.55rem; font-size:0.9rem; }
  .logo-text { font-size:1.1rem; }
  .logo img { width:48px; height:48px; }
}

@media (max-width:1024px) {
  .header-nav { display:none; }
  .hamburger { display:flex; }
  #navUserBlock { flex-shrink:0; }
  .nav-user { padding:0.3rem 0.45rem; gap:0.4rem; }
  .nav-user-info { display:none; }
  .btn-nav-logout { display:none; }
  .btn-login { font-size:0.85rem !important; padding:8px 14px !important; }
  .hero-inner { grid-template-columns:1fr; gap:2rem; }
  .hero-card { max-width:520px; margin:0 auto; width:100%; }
  .stages-grid { grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); }
  .topics-grid { grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); }
  .file-list { grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); }
  .video-grid { grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); }
}

@media (max-width:768px) {
  header { padding:0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left)); }
  .header-inner { height:72px; gap:0.5rem; }
  .logo img { width:48px; height:48px; }
  .logo-text { font-size:1.1rem; }
  .main { padding:1.25rem max(1rem, env(safe-area-inset-left)); }
  section { padding:3rem 1rem; }
  .section-title { font-size:clamp(1.6rem, 5vw, 2.1rem); }
  .page-header { padding:2rem 1rem 1.75rem; }
  .page-header h1 { font-size:clamp(1.5rem, 5vw, 2rem); }
  .hero { min-height:auto; padding:2.5rem 1rem 3rem; }
  .hero-card { display:none; }
  .hero-btns { flex-direction:column; width:100%; }
  .hero-btns .btn-primary, .hero-btns .btn-secondary { width:100%; }
  .stages-grid, .topics-grid, .file-list, .video-grid { grid-template-columns:1fr; gap:1rem; }
  .stage-card { padding:1.5rem 1.25rem; }
  .topic-card { padding:1rem 1.25rem; }
  .file-item { flex-wrap:wrap; }
  .file-actions { width:100%; margin-top:0.5rem; padding-top:0.5rem; border-top:1px solid var(--border2); }
  .leaderboard-table { overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .lb-header, .lb-row { grid-template-columns:44px minmax(120px, 1fr) 70px; min-width:0; padding:0.85rem 1rem; }
  .lb-group, .lb-tasks { display:none; }
  .author-card { grid-template-columns:1fr; text-align:center; padding:2rem 1.5rem; }
  .author-stats { justify-content:center; }
  .author-profile-head { flex-direction:column; text-align:center; padding:2rem 1.25rem; }
  .author-profile-stats { grid-template-columns:1fr; }
  .author-profile-body { padding:1.5rem 1.25rem; }
  .modal { height:100dvh; max-height:100dvh; border-radius:0; max-width:100%; }
  .single-pdf-wrap iframe { height:65dvh; }
  .toast { left:1rem; right:1rem; bottom:max(1rem, env(safe-area-inset-bottom)); max-width:none; transform:translateY(80px); }
  .toast.show { transform:translateY(0); }
  .auth-wrap { padding:1rem; }
  .auth-card { padding:2rem 1.25rem; }
  .test-result-detail { grid-template-columns:repeat(3, 1fr); gap:0.5rem; }
  .test-option { padding:0.9rem 1rem; }
}

@media (max-width:480px) {
  .header-inner { height:64px; }
  .logo img { width:42px; height:42px; border-radius:10px; }
  .logo-sub { display:none; }
  .logo-text { font-size:1rem; }
  .logo { gap:8px; }
  .nav-user-avatar { width:32px; height:32px; font-size:0.8rem; }
  .nav-user-name { max-width:75px; font-size:0.78rem; }
  .btn-nav-logout { padding:0.3rem 0.5rem; font-size:0.75rem; }
  .file-num, .topic-num { width:40px; height:40px; font-size:0.88rem; border-radius:10px; }
  .topic-info h4 { font-size:0.95rem; }
  .btn-view, .btn-dl { font-size:0.82rem; padding:0.4rem 0.75rem; min-height:38px; }
  .stage-num { width:46px; height:46px; font-size:1.2rem; }
  .test-result-score { font-size:3rem; }
  .test-result-detail { grid-template-columns:1fr 1fr 1fr; }
  .test-option { font-size:0.95rem; }
  .option-letter { width:34px; height:34px; font-size:0.9rem; }
}

@media (max-width:360px) {
  .logo-text { font-size:0.95rem; }
  .nav-user-name { display:none; }
  .nav-user { padding:0.28rem; }
  .hero h1 { font-size:1.7rem; }
  .section-tag { font-size:0.75rem; padding:0.3rem 0.85rem; }
}

@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation-duration:0.01ms !important; transition-duration:0.01ms !important; }
}

/* ===== DROPDOWN CHEVRON (icons.js o'zgartirmasligi uchun CSS bilan) ===== */
.header-nav .dropdown > a::after {
  content: ' ▾';
  font-size: 0.75em;
  opacity: 0.7;
}
.header-nav .dropdown.active > a::after {
  content: ' ▴';
}

/* ===== DROPDOWN BUTTON TRIGGER ===== */
.header-nav .dropdown > .dd-btn {
  color: var(--navy);
  background: none;
  border: none;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  transition: color 0.18s, background 0.18s;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Outfit', sans-serif;
  flex-shrink: 0;
}
.header-nav .dropdown > .dd-btn::after {
  content: '▾';
  font-size: 0.75em;
  opacity: 0.65;
  transition: transform 0.2s;
}
.header-nav .dropdown.active > .dd-btn::after {
  transform: rotate(180deg);
}
.header-nav .dropdown > .dd-btn:hover {
  color: var(--teal);
  background: rgba(42,191,171,0.08);
}
.header-nav .dropdown.active > .dd-btn {
  color: var(--navy);
  background: linear-gradient(135deg,rgba(42,191,171,0.15),rgba(27,43,107,0.06));
  box-shadow: inset 0 0 0 1.5px rgba(42,191,171,0.35);
}

/* ===== CSS-ONLY DROPDOWN (JS kerak emas) ===== */
.dropdown { position: relative; }

/* Hover bilan ochiladi */
.dropdown:hover > .dropdown-menu {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* JS bilan ochilganda ham ishlaydi */
.dropdown-menu.open {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu {
  display: none;
  position: absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  z-index: 99999 !important;
  background: white !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 48px rgba(27,43,107,0.18) !important;
  border: 1.5px solid rgba(42,191,171,0.25) !important;
  min-width: 260px !important;
  overflow: hidden !important;
}

/* dd-btn span stil */
.header-nav .dropdown > .dd-btn {
  color: var(--navy) !important;
  background: none !important;
  border: none !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  padding: 0.45rem 0.7rem !important;
  border-radius: 9px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  font-family: 'Outfit', sans-serif !important;
  user-select: none;
}
.header-nav .dropdown > .dd-btn::after {
  content: ' ▾';
  font-size: 0.75em;
  opacity: 0.6;
  margin-left: 2px;
}
.header-nav .dropdown:hover > .dd-btn {
  color: var(--teal) !important;
  background: rgba(42,191,171,0.08) !important;
}
