/* ═══════════════════════════════════════════════════════════════
   E-Notarius AI — Styles v1.0
   e-notarius.uz uslubidagi dizayn + AI qo'shimchalar
═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Colors — e-notarius.uz style */
  --dark:       #1e1e2e;
  --dark-2:     #262637;
  --charcoal:   #2d2d3f;
  --panel:      #f8f9fb;
  --white:      #ffffff;
  --gold:       #c9a961;
  --gold-light: #e5c97a;
  --gold-dark:  #8b7433;
  --orange:     #f57c00;
  --orange-light: #ffb74d;
  --blue:       #1976d2;
  --blue-light: #42a5f5;
  --green:      #4caf50;
  --purple:     #7b1fa2;
  --red:        #e53935;
  --text:       #2d2d3f;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border:     #e5e7eb;
  --border-dark: #3a3a4d;
  --shadow-sm:  0 2px 4px rgba(0,0,0,0.06);
  --shadow:     0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 30px rgba(0,0,0,0.12);
  --radius:     10px;
  --radius-lg:  16px;
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════════════ */
.header {
  background: var(--dark);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logo-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}
.logo-text { line-height: 1.2; }
.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-light);
}
.logo-sub {
  font-size: 0.65rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  border-radius: 6px;
  transition: var(--transition);
  letter-spacing: 0.02em;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-link.active { color: var(--gold-light); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switch {
  display: flex;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.lang-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 5px;
  transition: var(--transition);
}
.lang-btn.active {
  background: var(--gold);
  color: var(--dark);
}

.btn-login {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
  color: var(--dark);
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(201, 169, 97, 0.3);
}
.btn-login:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4); }
.ai-badge {
  background: var(--dark);
  color: var(--gold-light);
  font-size: 0.62rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.4rem;
}

/* ═══════════════════════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(30,30,46,0.92), rgba(45,45,63,0.85)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%'><defs><pattern id='p' width='60' height='60' patternUnits='userSpaceOnUse'><path d='M0 30 L60 30 M30 0 L30 60' stroke='%23c9a961' stroke-width='0.5' opacity='0.15'/></pattern></defs><rect width='100%' height='100%' fill='url(%23p)'/></svg>"),
    linear-gradient(135deg, var(--dark), var(--charcoal));
  background-size: cover;
  background-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(201,169,97,0.15), transparent 60%);
}
.hero-content {
  position: relative;
  padding: 80px 24px;
  z-index: 2;
  max-width: 900px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201, 169, 97, 0.15);
  border: 1px solid rgba(201, 169, 97, 0.3);
  color: var(--gold-light);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  margin-bottom: 20px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 20px;
}
.text-gold { color: var(--gold-light); }
.hero-desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  max-width: 640px;
  margin-bottom: 32px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 2px solid transparent;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  box-shadow: 0 4px 14px rgba(201, 169, 97, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(201, 169, 97, 0.5); }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.35);
}
.btn-ghost:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

.hero-search {
  display: flex;
  background: var(--white);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  max-width: 640px;
  margin-bottom: 40px;
}
.hero-search input {
  flex: 1;
  border: none;
  background: none;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  outline: none;
}
.hero-search button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--dark);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
}
.hero-search button:hover { background: var(--charcoal); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 720px;
}
.stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 16px 20px;
  backdrop-filter: blur(10px);
}
.stat-val {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1;
}
.stat-lbl {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════════════════════════ */
.section {
  padding: 80px 0;
  background: var(--white);
}
.section-dark {
  background: linear-gradient(180deg, #f8f9fb, #edf0f5);
}
.section-head {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 50px;
}
.section-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding: 4px 12px;
  background: rgba(245,124,0,0.1);
  border-radius: 20px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
  line-height: 1.25;
}
.section-desc {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════
   SERVICES CARDS
═══════════════════════════════════════════════════════════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}
.service-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: var(--transition);
  overflow: hidden;
  cursor: pointer;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.service-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.service-card:hover::before { transform: scaleX(1); }

.service-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  margin-bottom: 18px;
}
.icon-orange { background: rgba(245,124,0,0.12); color: var(--orange); }
.icon-blue { background: rgba(25,118,210,0.12); color: var(--blue); }
.icon-green { background: rgba(76,175,80,0.12); color: var(--green); }
.icon-purple { background: rgba(123,31,162,0.12); color: var(--purple); }
.icon-red { background: rgba(229,57,53,0.12); color: var(--red); }

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.service-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.service-arrow {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 1.4rem;
  color: var(--gold);
  opacity: 0;
  transition: var(--transition);
}
.service-card:hover .service-arrow { opacity: 1; transform: translateX(4px); }

.badge-new {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, var(--orange), #ff5722);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════
   LAWS SECTION
═══════════════════════════════════════════════════════════════ */
.laws-search { margin-bottom: 30px; }
.search-wrap {
  position: relative;
  max-width: 640px;
  margin: 0 auto 20px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-wrap input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--white);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.15);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.chip {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  transition: var(--transition);
}
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--dark); color: var(--gold-light); border-color: var(--dark); }
.chip-count {
  display: inline-block;
  background: rgba(0,0,0,0.08);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.68rem;
  margin-left: 4px;
  font-weight: 700;
}
.chip.active .chip-count { background: rgba(255,255,255,0.15); }

.laws-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.law-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: var(--transition);
  border-left: 3px solid var(--gold);
}
.law-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.law-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.law-num {
  background: var(--gold);
  color: var(--dark);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.law-cat {
  font-size: 0.7rem;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.law-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  line-height: 1.35;
}
.law-doc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.law-preview {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.law-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.law-link {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 500;
}
.law-link:hover { text-decoration: underline; }
.law-ai {
  margin-left: auto;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  transition: var(--transition);
}
.law-ai:hover { transform: scale(1.05); }

.laws-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
}
.page-btn {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  transition: var(--transition);
}
.page-btn:hover:not(:disabled) { border-color: var(--gold); }
.page-btn.active { background: var(--dark); color: var(--gold-light); border-color: var(--dark); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   TEMPLATES
═══════════════════════════════════════════════════════════════ */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.tpl-card {
  background: linear-gradient(135deg, var(--white), #fafbfc);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}
.tpl-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}
.tpl-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}
.tpl-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--dark);
  margin-bottom: 10px;
}
.tpl-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 20px;
}
.tpl-btn {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  transition: var(--transition);
}
.tpl-btn:hover { transform: scale(1.05); box-shadow: 0 4px 14px rgba(201,169,97,0.35); }

/* ═══════════════════════════════════════════════════════════════
   FEES TABLE
═══════════════════════════════════════════════════════════════ */
.fees-table-wrap {
  max-width: 900px;
  margin: 0 auto;
  overflow-x: auto;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.fees-table {
  width: 100%;
  background: var(--white);
  border-collapse: collapse;
}
.fees-table thead {
  background: var(--dark);
  color: var(--gold-light);
}
.fees-table th,
.fees-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.fees-table th {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.fees-table td { font-size: 0.92rem; }
.fees-table tbody tr:hover { background: #fafafa; }
.fees-table .fee-price { color: var(--gold-dark); font-weight: 700; }

/* ═══════════════════════════════════════════════════════════════
   MAP
═══════════════════════════════════════════════════════════════ */
.map-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.map-controls select,
.map-controls input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--white);
}
.map-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  height: 500px;
}
.map-list {
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--white);
}
.notary-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.notary-item:hover { background: #fafbfc; }
.notary-item.active { background: rgba(201,169,97,0.1); border-left: 3px solid var(--gold); padding-left: 13px; }
.notary-name { font-weight: 600; color: var(--dark); font-size: 0.9rem; margin-bottom: 4px; }
.notary-addr { font-size: 0.78rem; color: var(--text-muted); }
.notary-phone { font-size: 0.78rem; color: var(--blue); margin-top: 4px; }
.map-wrap {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-wrap iframe { display: block; height: 100%; }

/* ═══════════════════════════════════════════════════════════════
   FAQ
═══════════════════════════════════════════════════════════════ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}
.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-q {
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--dark);
  font-size: 0.95rem;
  transition: var(--transition);
}
.faq-q:hover { background: #fafbfc; }
.faq-arrow { color: var(--gold); transition: transform 0.3s; font-size: 1.2rem; }
.faq-item.open .faq-arrow { transform: rotate(180deg); }
.faq-a {
  padding: 0 24px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  color: var(--text);
  line-height: 1.7;
  font-size: 0.9rem;
  white-space: pre-line;
}
.faq-item.open .faq-a { padding: 0 24px 20px; max-height: 800px; }

/* ═══════════════════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════════════════ */
.footer {
  background: var(--dark);
  color: rgba(255,255,255,0.75);
  padding: 60px 0 20px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-desc {
  font-size: 0.88rem;
  margin-top: 20px;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}
.footer h4 {
  color: var(--gold-light);
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 8px; font-size: 0.88rem; }
.footer ul a { color: rgba(255,255,255,0.7); transition: var(--transition); }
.footer ul a:hover { color: var(--gold-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   AI MODAL
═══════════════════════════════════════════════════════════════ */
.ai-modal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 620px;
  max-height: calc(100vh - 100px);
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 300;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}
.ai-modal.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}
.ai-modal-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.ai-head {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--dark), var(--charcoal));
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.ai-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.ai-name {
  font-weight: 700;
  color: var(--gold-light);
  font-size: 0.95rem;
}
.ai-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.ai-modes {
  display: flex;
  gap: 4px;
  align-items: center;
}
.mode-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid transparent;
  color: rgba(255,255,255,0.7);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition);
}
.mode-btn:hover { background: rgba(255,255,255,0.15); }
.mode-btn.active {
  background: var(--gold);
  color: var(--dark);
  border-color: var(--gold-light);
}
.ai-close {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--white);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  margin-left: 4px;
  font-size: 1rem;
  transition: var(--transition);
}
.ai-close:hover { background: rgba(229,57,53,0.5); }

.ai-chat {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-welcome {
  text-align: center;
  padding: 20px;
  margin: auto;
}
.ai-welcome-icon { font-size: 3rem; margin-bottom: 16px; }
.ai-welcome h3 { color: var(--dark); font-family: 'Playfair Display', serif; margin-bottom: 8px; }
.ai-welcome p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 20px; }
.ai-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-suggestions button {
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  text-align: left;
  transition: var(--transition);
}
.ai-suggestions button:hover { border-color: var(--gold); background: rgba(201,169,97,0.05); }

.ai-msg {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.ai-msg.user .ai-msg-avatar { background: var(--blue-light); color: var(--white); }
.ai-msg.bot .ai-msg-avatar { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--dark); }
.ai-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 78%;
  font-size: 0.88rem;
  line-height: 1.55;
}
.ai-msg.user .ai-msg-bubble { background: var(--blue); color: var(--white); border-bottom-right-radius: 4px; }
.ai-msg.bot .ai-msg-bubble { background: var(--white); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--text); }
.ai-msg-bubble .law-ref {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(201,169,97,0.1);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  font-size: 0.78rem;
}
.ai-msg-bubble .law-ref b { color: var(--gold-dark); }

.typing-dots { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing-dots span {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-6px); opacity: 1; }
}

.ai-input-bar {
  padding: 12px;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ai-input-bar textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  max-height: 100px;
  line-height: 1.5;
  outline: none;
  transition: var(--transition);
}
.ai-input-bar textarea:focus { border-color: var(--gold); }
.ai-send {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 1.1rem;
  transition: var(--transition);
}
.ai-send:hover { transform: scale(1.05); }
.ai-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════
   TEMPLATE MODAL
═══════════════════════════════════════════════════════════════ */
.tpl-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.tpl-modal.open { display: flex; }
.tpl-modal-inner {
  background: var(--white);
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.tpl-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tpl-head h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--dark);
}
.tpl-head .ai-close { background: var(--panel); color: var(--text); }
.tpl-head .ai-close:hover { background: var(--red); color: var(--white); }
.tpl-form {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  color: var(--dark);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 5px;
}
.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,97,0.15);
}
.form-textarea { resize: vertical; min-height: 70px; }
.tpl-actions {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  background: #fafbfc;
}
.tpl-actions .btn-ghost {
  color: var(--text);
  border-color: var(--border);
}
.tpl-actions .btn-ghost:hover { border-color: var(--text); background: transparent; }
.tpl-actions .btn-primary { flex: 1; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════
   FAB
═══════════════════════════════════════════════════════════════ */
.fab-ai {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--dark);
  border: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(201,169,97,0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 250;
  transition: var(--transition);
}
.fab-ai:hover { transform: scale(1.1); box-shadow: 0 12px 32px rgba(201,169,97,0.5); }
.fab-icon { font-size: 1.4rem; }
.fab-label { font-size: 0.55rem; font-weight: 800; margin-top: -2px; }
.ai-modal.open ~ .fab-ai { display: none; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0;
         background: var(--dark); flex-direction: column; padding: 12px; }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .map-layout { grid-template-columns: 1fr; height: auto; }
  .map-list { max-height: 300px; }
}
@media (max-width: 600px) {
  .header-right .btn-login span:not(.ai-badge) { display: none; }
  .hero-content { padding: 60px 20px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 12px; }
  .stat-val { font-size: 1.4rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .ai-modal { bottom: 0; right: 0; left: 0; top: 0; width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .fab-ai { bottom: 16px; right: 16px; }
}
