/* style.css — Advokāta platforma
   Dizains pēc TautaAI.lv parauga: gaišs glassmorphism stils, indigo-violets
   gradients, Playfair Display + Inter tipogrāfija, "stikla" kartītes.

   PIEZĪME: fontu ielāde (Playfair Display / Inter / JetBrains Mono) tagad
   notiek caur <link rel="stylesheet"> katras lapas <head>, NEVIS @import
   šeit -- @import ir bloķējošs (pārlūkam jāparsē šis fails, PIRMS tas pat
   uzzina par fontu pieprasījumu), kas palēnina pirmo attēlojumu. */

* { box-sizing: border-box; }

:root {
  color-scheme: light; /* neļauj pārlūkam/OS piespiedu kārtā "auto-tumšot" lapu */
  /* Pamata toņi — gaišs, kristāla balts ar lavandas/zilu dvesmu */
  --ink: #F2F4FB;          /* gaišs fons (agrāk tumšs -- tagad gaišs, kā TautaAI) */
  --ink-2: rgba(255,255,255,0.62); /* "stikla" panelis */
  --paper: #FFFFFF;
  --paper-2: rgba(108,107,240,0.07);
  --charcoal: #17224D;      /* teksta krāsa */
  --seal: #6C6BF0;          /* zīmola akcents -- indigo-violets (agrāk sarkans) */
  --seal-2: #8B6BFF;
  --brass: #B9861B;         /* otrs akcents -- zelts */
  --slate: #5D6B94;         /* sekundārais teksts */
  --border: rgba(140,153,219,0.26);
  --border-h: rgba(108,107,240,0.55);
  --grad: linear-gradient(115deg,#5B8CFF 0%, #8B6BFF 55%, #B08BFF 100%);
  --shadow-card: 0 12px 34px rgba(84,102,190,0.13), 0 2px 6px rgba(84,102,190,0.07);
  --shadow-pop: 0 20px 50px rgba(84,102,190,0.20);
  --glass-line: inset 0 0 0 1px rgba(255,255,255,0.72), inset 0 1px 0 rgba(255,255,255,0.95);

  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--ink);
  background-image:
    radial-gradient(900px 520px at 12% -6%, rgba(91,140,255,.16), transparent 60%),
    radial-gradient(820px 560px at 88% -2%, rgba(155,107,255,.14), transparent 58%),
    radial-gradient(760px 520px at 82% 96%, rgba(240,86,126,.06), transparent 60%),
    radial-gradient(700px 480px at 8% 100%, rgba(34,199,154,.05), transparent 60%);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 600;
  margin-bottom: 12px;
}
.eyebrow.seal { color: var(--seal); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }

/* ---------- Nav (gaišs "stikla" topbar) ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 18px rgba(84,102,190,0.06);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--charcoal); }
.logo span {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.tabs { display: none; gap: 4px; align-items: center; }
.tabs a {
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  color: var(--slate); border-radius: 999px; transition: all .2s;
}
.tabs a:hover { color: var(--charcoal); background: rgba(255,255,255,0.9); box-shadow: 0 4px 14px rgba(84,102,190,0.08); }
.btn-outline {
  border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,0.72);
  padding: 8px 18px; font-size: 13px; font-weight: 600; color: var(--charcoal);
  backdrop-filter: blur(10px); transition: all .2s;
}
.btn-outline:hover { border-color: var(--border-h); color: var(--seal); background: #fff; }
.mobile-toggle { display: block; background: none; border: none; color: var(--charcoal); padding: 8px; }
.mobile-menu { display: none; border-top: 1px solid var(--border); background: rgba(255,255,255,0.92); backdrop-filter: blur(18px); }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 12px 24px; font-size: 14px; color: var(--charcoal); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) {
  .tabs { display: flex; }
  .btn-outline.desktop-only { display: inline-block; }
  .mobile-toggle { display: none; }
}

/* ---------- Buttons (pill, gradient) ---------- */
.btn-seal {
  background: var(--grad); color: #fff; border: none;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 24px rgba(108,107,240,.32), var(--glass-line);
  transition: all .2s;
}
.btn-seal:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(108,107,240,.4), var(--glass-line); }
.btn-ghost {
  background: rgba(255,255,255,0.7); color: var(--charcoal); border: 1px solid var(--border);
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 14px;
  backdrop-filter: blur(10px); transition: all .2s;
}
.btn-ghost:hover { border-color: var(--border-h); color: var(--seal); }
.btn-dark {
  background: var(--charcoal); color: #fff; border: none; padding: 11px 20px;
  border-radius: 999px; font-weight: 600; font-size: 13px; transition: all .2s;
}
.btn-dark:hover { background: var(--seal); }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 120px; position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: 60px; align-items: center; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1fr 420px; } }
.hero-content { max-width: 640px; }
.hero h1 { font-size: 48px; line-height: 1.08; max-width: 640px; color: var(--charcoal); }
@media (min-width: 768px) { .hero h1 { font-size: 56px; } }
.hero-visual { display: flex; flex-direction: column; gap: 24px; }
.hero-card { position: relative; }
.hero-portrait { aspect-ratio: 3/4; max-width: 100%; max-height: 520px; object-fit: cover; }
@media (min-width: 1024px) { .hero-portrait { max-height: 480px; } }
.hero-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.feature-item { background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3); border: 1px solid var(--border); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-card), var(--glass-line); text-align: center; }
.feature-icon { font-size: 28px; margin-bottom: 8px; }
.feature-label { font-size: 13px; font-weight: 600; color: var(--charcoal); margin: 0 0 4px; }
.feature-desc { font-size: 12px; color: var(--slate); margin: 0; line-height: 1.4; }
.redact-line { position: relative; display: inline-block; overflow: hidden; }
.redact-line .bar {
  position: absolute; inset: 0; background: var(--grad);
  transform-origin: left; animation: lift 1.1s cubic-bezier(.65,0,.35,1) forwards;
  border-radius: 6px;
}
@keyframes lift { 0% { transform: scaleX(1); } 45% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .redact-line .bar { animation: none; transform: scaleX(0); } }
.hero p.lead { color: var(--slate); max-width: 520px; font-size: 17px; line-height: 1.7; margin-top: 28px; }
.hero .cta-row { display: flex; gap: 16px; margin-top: 36px; flex-wrap: wrap; }

/* ---------- Sections (viss gaišs, vienoti) ---------- */
section { padding: 90px 0; }
.section-paper, .section-ink { background: transparent; color: var(--charcoal); }

/* About */
.about-grid { display: grid; gap: 44px; align-items: start; }
@media (min-width: 768px) { .about-grid { grid-template-columns: 280px 1fr; } }
.about-grid-single { display: block; }
.portrait {
  aspect-ratio: 3/4; background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 18px; display: flex; align-items: center; justify-content: center;
  position: relative; box-shadow: var(--shadow-card), var(--glass-line); overflow: hidden;
}
.stamp {
  position: absolute; bottom: -16px; right: -16px; width: 78px; height: 78px;
  border-radius: 50%; background: var(--grad); box-shadow: 0 10px 24px rgba(108,107,240,.35);
  display: flex; align-items: center; justify-content: center; transform: rotate(-8deg);
}
.stamp span { font-family: var(--font-mono); font-size: 9px; color: #fff; text-align: center; line-height: 1.3; font-weight: 600; }
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; max-width: 420px; margin-top: 36px; }
.stats-row .num {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.stats-row .label { font-size: 12px; color: var(--slate); margin-top: 4px; }

/* Services */
.services-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .services-grid { grid-template-columns: 1fr 1fr; } }
.service-card {
  background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 18px; padding: 26px;
  box-shadow: var(--shadow-card), var(--glass-line); transition: all .25s;
}
.service-card:hover { border-color: var(--border-h); transform: translateY(-3px); box-shadow: var(--shadow-pop), var(--glass-line); }
.service-card .ref { font-family: var(--font-mono); font-size: 11px; color: var(--seal); font-weight: 600; margin-bottom: 14px; }
.service-card h3 { font-size: 19px; margin-bottom: 10px; }
.service-card p { color: var(--slate); font-size: 14px; line-height: 1.6; margin: 0; }

/* Retainer */
.toggle-group { display: inline-flex; background: rgba(255,255,255,0.6); backdrop-filter: blur(10px); border-radius: 999px; padding: 4px; border: 1px solid var(--border); }
.toggle-group button { background: none; border: none; padding: 8px 16px; font-size: 13px; font-weight: 500; border-radius: 999px; color: var(--slate); }
.toggle-group button.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(108,107,240,.3); }
.plans-grid { display: grid; gap: 22px; margin-top: 30px; }
@media (min-width: 768px) { .plans-grid { grid-template-columns: repeat(3,1fr); } }
.plan-card {
  background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 18px; padding: 30px;
  display: flex; flex-direction: column; box-shadow: var(--shadow-card), var(--glass-line);
}
.plan-card.featured { border: 2px solid transparent; background: linear-gradient(var(--ink-2),var(--ink-2)) padding-box, var(--grad) border-box; box-shadow: var(--shadow-pop), var(--glass-line); }
.plan-price { font-family: var(--font-display); font-size: 34px; font-weight: 700; }
.plan-features { list-style: none; padding: 0; margin: 16px 0 24px; flex: 1; }
.plan-features li { font-size: 14px; padding: 6px 0; display: flex; gap: 8px; color: var(--charcoal); }
.plan-features li::before { content: '✦'; color: var(--seal); font-size: 11px; }

/* Testimonials */
.quotes-grid { display: grid; gap: 22px; }
@media (min-width: 768px) { .quotes-grid { grid-template-columns: repeat(3,1fr); } }
blockquote {
  margin: 0; background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 18px; padding: 24px;
  box-shadow: var(--shadow-card), var(--glass-line);
}
blockquote p { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 16px; color: var(--charcoal); }
blockquote cite { display: block; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--slate); font-style: normal; }

/* Contact */
.contact-grid { display: grid; gap: 44px; }
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.field {
  width: 100%; background: rgba(255,255,255,0.82); border: 1px solid var(--border);
  border-radius: 13px; padding: 12px 16px; font-size: 14px; margin-bottom: 14px;
  box-shadow: inset 0 1px 3px rgba(84,102,190,0.06); transition: border-color .2s, box-shadow .2s;
}
.field:focus { outline: none; border-color: var(--seal); box-shadow: 0 0 0 3px rgba(108,107,240,.15); background: #fff; }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 36px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-inner p { font-family: var(--font-mono); font-size: 11px; color: var(--slate); }

/* ---------- Auth pages ---------- */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-box {
  width: 100%; max-width: 380px; background: var(--ink-2); backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border); border-radius: 22px; padding: 36px 30px;
  box-shadow: var(--shadow-pop), var(--glass-line);
}
.demo-note { font-family: var(--font-mono); font-size: 11px; color: var(--slate); background: rgba(255,255,255,0.6); border: 1px solid var(--border); border-radius: 13px; padding: 12px; margin-bottom: 20px; }
.err { color: #F0567E; font-size: 13px; margin: 8px 0; }

/* ---------- Dashboard layout ---------- */
.dash { min-height: 100vh; display: flex; flex-direction: column; background: transparent; color: var(--charcoal); }
@media (min-width: 768px) { .dash { flex-direction: row; } }
.sidebar {
  background: rgba(255,255,255,0.62); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-right: 1px solid var(--border); flex-shrink: 0; color: var(--charcoal);
}
@media (min-width: 768px) { .sidebar { width: 260px; display: flex; flex-direction: column; } }
.sidebar-head { padding: 24px; display: none; }
@media (min-width: 768px) { .sidebar-head { display: block; } }
.sidebar-nav { display: flex; overflow-x: auto; padding: 8px; gap: 3px; }
@media (min-width: 768px) { .sidebar-nav { flex-direction: column; overflow: visible; } }
.sidebar-nav a, .sidebar-nav button.navlink {
  padding: 10px 14px; font-size: 13px; font-weight: 500; white-space: nowrap;
  color: var(--slate); border-radius: 13px; transition: all .2s;
  border: 1px solid transparent; background: none; text-align: left; width: 100%;
}
.sidebar-nav a:hover, .sidebar-nav button.navlink:hover { color: var(--charcoal); background: rgba(255,255,255,0.8); }
.sidebar-nav a.active, .sidebar-nav button.navlink.active {
  color: var(--seal); background: rgba(255,255,255,0.9); font-weight: 600;
  box-shadow: 0 6px 18px rgba(108,107,240,.14), var(--glass-line);
  border: 1px solid rgba(108,107,240,.22);
}
.sidebar-logout { margin-top: auto; padding: 20px; font-size: 13px; color: var(--slate); background: none; border: none; text-align: left; display: block; }
.sidebar-logout:hover { color: #F0567E; }
.dash-main { flex: 1; padding: 24px; }
@media (min-width: 768px) { .dash-main { padding: 40px; } }

.stat-card {
  background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 18px; padding: 20px;
  box-shadow: var(--shadow-card), var(--glass-line);
}
.stat-card .num {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.stat-card .label { font-size: 12px; color: var(--slate); margin-top: 4px; }
.stats-grid { display: grid; gap: 16px; margin-bottom: 36px; }
.stats-grid.cols-3 { grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); }
.stats-grid.cols-4 { grid-template-columns: repeat(auto-fit,minmax(110px,1fr)); }

.card-row {
  background: var(--ink-2); backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 12px;
  box-shadow: var(--shadow-card), var(--glass-line);
}
.badge { font-size: 11px; padding: 4px 12px; border-radius: 999px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.badge.b-jauna, .badge.b-nosūtīts { background: rgba(185,134,27,.13); color: var(--brass); }
.badge.b-darbā { background: rgba(108,107,240,.13); color: var(--seal); }
.badge.b-pabeigta, .badge.b-apmaksāts { background: rgba(34,199,154,.15); color: #0F9068; }
.badge.b-kavēts { background: rgba(240,86,126,.13); color: #F0567E; }

.form-card {
  background: var(--ink-2); backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border); border-radius: 18px; padding: 22px; margin-bottom: 22px;
  box-shadow: var(--shadow-card), var(--glass-line);
}
.form-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .form-grid.cols-3 { grid-template-columns: repeat(3,1fr); } .form-grid.cols-4 { grid-template-columns: repeat(4,1fr); } }

.ai-result {
  margin-top: 22px; background: var(--ink-2); backdrop-filter: blur(16px);
  border: 1px solid var(--border-h); border-radius: 16px; padding: 22px;
  white-space: pre-wrap; font-size: 14px; line-height: 1.65; box-shadow: var(--shadow-card), var(--glass-line);
}

.chat-box { display: flex; flex-direction: column; height: calc(100vh - 180px); }
.chat-msgs {
  flex: 1; background: var(--ink-2); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 16px; padding: 18px; overflow-y: auto; margin-bottom: 14px;
}
.msg { max-width: 80%; padding: 10px 16px; border-radius: 14px; font-size: 14px; margin-bottom: 12px; display: inline-block; }
.msg.mine { background: var(--grad); color: #fff; float: right; clear: both; box-shadow: 0 6px 16px rgba(108,107,240,.25); }
.msg.theirs { background: rgba(255,255,255,0.85); color: var(--charcoal); float: left; clear: both; border: 1px solid var(--border); }
.chat-form { display: flex; gap: 12px; clear: both; }
.chat-form input { flex: 1; }

.hidden { display: none !important; }

/* ---------- Valodu pārslēgšana ---------- */
.lang-switcher { display: flex; gap: 4px; align-items: center; }
.lang-btn {
  background: none; border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.6); border-radius: 4px; padding: 3px 7px;
  font-size: 11px; font-family: var(--font-mono); cursor: pointer;
  letter-spacing: 0.05em; transition: all 0.15s;
}
.lang-btn:hover { color: white; border-color: rgba(255,255,255,0.5); }
.lang-btn.active { background: var(--grad); border-color: transparent; color: white; }
.lang-btn-light { border-color: rgba(23,34,77,0.2); color: rgba(23,34,77,0.72); }
.lang-btn-light:hover { color: rgba(23,34,77,0.8); border-color: rgba(23,34,77,0.4); }
.lang-btn-light.active { background: var(--grad); border-color: transparent; color: white; }

/* ---------- Valodu dropdown ---------- */
.lang-switcher { position: relative; display: inline-block; }
.lang-btn-main {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--grad); color: white; border: none;
  border-radius: 999px; padding: 5px 12px; font-size: 12px;
  font-family: var(--font-mono); font-weight: 600; cursor: pointer;
  letter-spacing: 0.05em; box-shadow: 0 4px 12px rgba(108,107,240,.3);
}
.lang-btn-main::after { content: '▾'; font-size: 10px; }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(84,102,190,0.16); overflow: hidden;
  min-width: 140px; z-index: 100;
}
.lang-switcher.open .lang-dropdown { display: block; }
.lang-option {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  color: var(--charcoal); cursor: pointer; border: none;
  background: none; width: 100%; text-align: left; transition: background .15s;
}
.lang-option:hover { background: var(--paper-2); }
.lang-option.active { color: var(--primary); font-weight: 700; }
.lang-option .lang-code { font-family: var(--font-mono); font-size: 11px; color: var(--slate); min-width: 24px; }
