/* ============================================================
   КФА — Казахстанская федерация аудиторов
   Custom CSS (дополнение к Tailwind CDN)
   ============================================================ */

/* Google Fonts import (fallback if not in HTML) */

/* ---- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: #0F1B2D;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Scrollbar -------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #F4F4F5; }
::-webkit-scrollbar-thumb { background: #A0A7B3; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #6E7A8A; }

/* ---- Typography ------------------------------------------- */
.font-display { font-family: 'Prata', serif; }
.font-body    { font-family: 'Inter', sans-serif; }

/* ---- Header ----------------------------------------------- */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(15, 27, 45, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: box-shadow 0.3s ease;
}
#site-header.scrolled {
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}

/* ---- Dropdown nav ----------------------------------------- */
.nav-dropdown {
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ---- Animations ------------------------------------------- */
.anim-hidden { opacity: 0; transform: translateY(24px); }
.anim-visible {
  animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Red accent line -------------------------------------- */
.red-line {
  display: inline-block;
  width: 48px; height: 3px;
  background: #E10600;
  border-radius: 2px;
}

/* ---- Cards ------------------------------------------------ */
.card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(15,27,45,0.07);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover {
  box-shadow: 0 8px 40px rgba(15,27,45,0.14);
  transform: translateY(-2px);
}

/* ---- Buttons ---------------------------------------------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: #E10600; color: #ffffff;
  padding: 14px 28px; border-radius: 10px;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  border: none; cursor: pointer;
}
.btn-primary:hover {
  background: #C40500;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(225,6,0,0.35);
}

.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: #ffffff;
  padding: 13px 28px; border-radius: 10px;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  border: 1.5px solid rgba(255,255,255,0.4);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.7);
}

.btn-navy {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0F1B2D; color: #ffffff;
  padding: 14px 28px; border-radius: 10px;
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  border: none; cursor: pointer;
}
.btn-navy:hover { background: #1C2430; box-shadow: 0 4px 16px rgba(15,27,45,0.25); }

/* ---- Hero dot pattern ------------------------------------- */
.dot-pattern {
  background-image: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ---- Section -------------------------------------------- */
.section-label {
  font-size: 12px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: #E10600;
}

/* ---- Stats counter ---------------------------------------- */
.stat-number {
  font-family: 'Prata', serif;
  font-size: clamp(36px, 5vw, 56px);
  color: #0F1B2D;
  line-height: 1;
}

/* ---- Table ------------------------------------------------ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  background: #F4F4F5;
  color: #6E7A8A;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #E6E8EB;
}
.data-table tbody tr {
  border-bottom: 1px solid #F4F4F5;
  transition: background 0.15s ease;
}
.data-table tbody tr:hover { background: #FAFAFA; }
.data-table tbody td { padding: 14px 16px; font-size: 14px; color: #0F1B2D; }
.data-table .td-sub { font-size: 12px; color: #6E7A8A; margin-top: 2px; }

/* ---- Status badge ----------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-active   { background: #D1FAE5; color: #065F46; }
.badge-inactive { background: #FEE2E2; color: #991B1B; }
.badge-pending  { background: #FEF3C7; color: #92400E; }

/* ---- Search input ----------------------------------------- */
.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 1.5px solid #E6E8EB;
  border-radius: 12px;
  font-size: 15px;
  color: #0F1B2D;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-input:focus {
  border-color: #0F1B2D;
  box-shadow: 0 0 0 3px rgba(15,27,45,0.08);
}
.search-wrapper { position: relative; }
.search-icon {
  position: absolute; left: 16px; top: 50%;
  transform: translateY(-50%);
  color: #A0A7B3; pointer-events: none;
}

/* ---- Document card ---------------------------------------- */
.doc-card {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px;
  background: #ffffff;
  border: 1px solid #E6E8EB;
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
}
.doc-card:hover {
  border-color: #0F1B2D;
  box-shadow: 0 4px 20px rgba(15,27,45,0.08);
}
.doc-icon {
  width: 44px; height: 44px;
  background: #F4F4F5;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #E10600;
}

/* ---- Form ------------------------------------------------- */
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: #1C2430;
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #E6E8EB;
  border-radius: 10px;
  font-size: 15px; color: #0F1B2D;
  background: #ffffff; outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.form-input:focus {
  border-color: #0F1B2D;
  box-shadow: 0 0 0 3px rgba(15,27,45,0.08);
}

/* ---- Tabs ------------------------------------------------- */
.tab-btn {
  padding: 10px 20px;
  font-size: 14px; font-weight: 500;
  border-radius: 8px;
  border: none; background: transparent;
  color: #6E7A8A; cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn.active {
  background: #0F1B2D; color: #ffffff;
}
.tab-btn:not(.active):hover { background: #F4F4F5; color: #0F1B2D; }

/* ---- Footer ----------------------------------------------- */
#site-footer { background: #0F1B2D; }

/* ---- Mobile menu ------------------------------------------ */
#mobile-nav {
  display: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 16px 0;
}
#mobile-nav.open { display: block; }

/* ---- News card -------------------------------------------- */
.news-card { display: flex; flex-direction: column; height: 100%; }
.news-card-img {
  height: 200px; background: #E6E8EB;
  border-radius: 12px 12px 0 0; overflow: hidden;
}
.news-tag {
  display: inline-block;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---- Pagination ------------------------------------------- */
.page-btn {
  width: 36px; height: 36px;
  border-radius: 8px; border: 1.5px solid #E6E8EB;
  background: white; color: #0F1B2D;
  font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: #0F1B2D; }
.page-btn.active { background: #0F1B2D; color: white; border-color: #0F1B2D; }

/* ---- Mobile responsiveness -------------------------------- */
@media (max-width: 768px) {
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- Language switcher ------------------------------------ */
.kfa-lang-switcher { display: flex; align-items: center; gap: 4px; }

.kfa-lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #A0A7B3;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  min-width: 34px;
  text-align: center;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.kfa-lang-btn:hover {
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
}
.kfa-lang-btn.kfa-lang-active {
  background: #E10600;
  border-color: #E10600;
  color: #ffffff;
}

/* ---- Active nav link -------------------------------------- */
.nav-link.active {
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  font-weight: 600;
}

/* ---- Footer links ----------------------------------------- */
.footer-link {
  color: #6E7A8A;
  text-decoration: none;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  transition: color 0.2s ease;
}
.footer-link:hover { color: #ffffff; }

/* ---- Select custom arrow ---------------------------------- */
select.form-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236E7A8A' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

/* ---- Form input height consistency ----------------------- */
.form-input { padding: 14px 16px; }
select.form-input { padding: 14px 44px 14px 16px; }

/* ---- Tab btn: prevent wrapping --------------------------- */
.tab-btn { white-space: nowrap; }

/* ---- Quick action buttons -------------------------------- */
.quick-action-btn {
  padding: 16px;
  background: #F4F4F5;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
  display: block;
  text-decoration: none;
  width: 100%;
}
.quick-action-btn:hover { background: #E6E8EB; }

/* ---- Cabinet grid responsive ----------------------------- */
.cabinet-grid { display: grid; grid-template-columns: 260px 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) {
  .cabinet-grid { grid-template-columns: 1fr; }
}

/* ---- About & contacts responsive grids ------------------- */
@media (max-width: 768px) {
  .about-grid   { grid-template-columns: 1fr !important; gap: 40px !important; }
  .req-grid     { grid-template-columns: 1fr !important; }
  .contacts-grid { grid-template-columns: 1fr !important; }
}

/* ---- Education tab bar on small screens ------------------ */
.edu-tabs-wrap { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
@media (max-width: 640px) {
  .edu-tabs-wrap { flex-wrap: wrap; }
}

/* ---- Focus-visible styles -------------------------------- */
.btn-primary:focus-visible,
.btn-outline:focus-visible,
.btn-navy:focus-visible {
  outline: 2px solid #E10600;
  outline-offset: 3px;
}
.nav-link:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid #E10600;
  outline-offset: 2px;
}
.doc-card:focus-visible {
  outline: 2px solid #0F1B2D;
  outline-offset: 2px;
}

/* ---- News card accent bar -------------------------------- */
.news-card-accent { border-radius: 16px 16px 0 0; }

/* ---- Body background utility ----------------------------- */
body.bg-snow { background: #F4F4F5; }

/* ---- Keyframes (moved from index.html) ------------------- */
@keyframes scrollPulse { 0%,100%{opacity:0.4} 50%{opacity:1} }
@media (max-width: 1200px) { .desktop-nav { display: none; } }
