/* ==========================================================================
   Takin - Theme & Multilingual Layout Engine (Light/Dark + LTR/RTL)
   Strictly modular • <150 lines • Zero-leakage CSS variables
   ========================================================================== */

/* --- Light Mode Palette --- */
[data-theme="light"] {
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-inset: #f1f5f9;
  --border-hairline: rgba(0, 0, 0, 0.09);
  --border-focus: rgba(14, 165, 233, 0.6);
  --border-emerald: rgba(16, 185, 129, 0.5);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --text-mono: #0284c7;
}

[data-theme="light"],
[data-theme="light"] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

[data-theme="light"] .site-nav {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .brand-name,
[data-theme="light"] .nav-brand-text,
[data-theme="light"] .legal-brand {
  color: #0f172a !important;
  background: none !important;
  -webkit-text-fill-color: #0f172a !important;
}

[data-theme="light"] .brand-sub {
  color: #0284c7 !important;
}

[data-theme="light"] .docket-card,
[data-theme="light"] .step-card,
[data-theme="light"] .demo-card,
[data-theme="light"] .faq-item,
[data-theme="light"] .form-card,
[data-theme="light"] .info-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .docket-item {
  color: #334155;
  border-bottom-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .demo-code-box {
  background: #0f172a;
  color: #38bdf8;
}

[data-theme="light"] .demo-directive-box {
  background: #f0fdf4;
  border-color: rgba(16, 185, 129, 0.35);
  color: #166534;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-select:focus,
[data-theme="light"] .form-textarea:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
}

[data-theme="light"] h1,
[data-theme="light"] h2,
[data-theme="light"] h3,
[data-theme="light"] .docket-title,
[data-theme="light"] .step-title,
[data-theme="light"] .faq-q,
[data-theme="light"] .hero-title {
  color: #0f172a !important;
}

/* --- Light Mode Hero Dossier Card & Metrics (High Contrast) --- */
[data-theme="light"] .dossier-header-strip {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  color: #334155 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .dossier-stamp-seal {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #047857 !important;
}

[data-theme="light"] .dossier-hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .dossier-tag {
  background: rgba(14, 165, 233, 0.12) !important;
  color: #0369a1 !important;
  border-color: #0284c7 !important;
}

[data-theme="light"] .dossier-title {
  color: #0f172a !important;
}

[data-theme="light"] .dossier-lead {
  color: #1e293b !important;
  font-weight: 450 !important;
}

[data-theme="light"] .btn-pill-primary {
  background: #0f172a !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.2) !important;
}

[data-theme="light"] .btn-pill-primary:hover {
  background: #1e293b !important;
  color: #ffffff !important;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.3) !important;
}

[data-theme="light"] .btn-pill-secondary {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(0, 0, 0, 0.18) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .btn-pill-secondary:hover {
  background: #f8fafc !important;
  color: #0f172a !important;
  border-color: rgba(0, 0, 0, 0.32) !important;
}

[data-theme="light"] .dossier-seal-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .dossier-seal-label {
  color: #475569 !important;
}

[data-theme="light"] .dossier-seal-status {
  color: #059669 !important;
}

[data-theme="light"] .metrics-strip {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .metric-cell {
  border-left-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .metric-val {
  color: #0f172a !important;
  font-weight: 900 !important;
}

[data-theme="light"] .metric-label {
  color: #334155 !important;
  font-weight: 600 !important;
}

/* --- Nav Controls (Theme & Language Switchers) --- */
.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.theme-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.lang-switcher {
  display: inline-flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.lang-btn:hover {
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
}

/* --- LTR Layout Overrides (English & Russian) --- */
html[dir="ltr"] body {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .site-nav-inner {
  flex-direction: row;
}

html[dir="ltr"] .docket-list,
html[dir="ltr"] .faq-a,
html[dir="ltr"] .faq-q,
html[dir="ltr"] .demo-step p,
html[dir="ltr"] .step-desc,
html[dir="ltr"] .step-title,
html[dir="ltr"] .docket-title,
html[dir="ltr"] .docket-desc,
html[dir="ltr"] .dossier-title,
html[dir="ltr"] .dossier-lead,
html[dir="ltr"] .form-group label,
html[dir="ltr"] .form-label,
html[dir="ltr"] .form-hint {
  text-align: left !important;
  direction: ltr !important;
}

html[dir="ltr"] .dossier-tag {
  border-right: none !important;
  border-left: 3px solid var(--accent-blue) !important;
}

html[dir="ltr"] .metric-cell {
  border-left: none !important;
  border-right: 1px solid var(--border-hairline) !important;
}

html[dir="ltr"] .metric-cell:last-child {
  border-right: none !important;
}

html[dir="ltr"] .form-input,
html[dir="ltr"] .form-select,
html[dir="ltr"] .form-textarea,
html[dir="ltr"] input[type="text"],
html[dir="ltr"] input[type="email"],
html[dir="ltr"] input[type="tel"],
html[dir="ltr"] input[type="url"],
html[dir="ltr"] select,
html[dir="ltr"] textarea {
  direction: ltr !important;
  text-align: left !important;
}

html[dir="ltr"] .form-input::placeholder,
html[dir="ltr"] .form-textarea::placeholder,
html[dir="ltr"] input::placeholder,
html[dir="ltr"] textarea::placeholder {
  direction: ltr !important;
  text-align: left !important;
}

html[dir="ltr"] .checkbox-wrap {
  flex-direction: row !important;
  text-align: left !important;
}

html[dir="ltr"] .checkbox-wrap span {
  text-align: left !important;
}

/* Report Card Badge Styling - Prevents clumsy multi-line break capsules */
.report-badge-pill {
  white-space: nowrap !important;
  border-radius: 6px !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: inline-flex !important;
  align-items: center !important;
}

html[dir="ltr"] .docket-item {
  padding-right: 0;
  padding-left: 1.4rem;
}

html[dir="ltr"] .docket-item::before {
  right: auto;
  left: 0;
}

html[dir="ltr"] .legal-callout.warning {
  border-right: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 4px solid var(--cyber-warning, #f59e0b);
}

html[dir="ltr"] .legal-callout.emerald {
  border-right: 1px solid rgba(16, 185, 129, 0.2);
  border-left: 4px solid var(--cyber-emerald, #10b981);
}

/* --- Sample Reports Card Theme Alignment --- */
/* Default (Dark Mode) */
.report-card,
.case-card {
  background: rgba(18, 22, 31, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  color: #f8fafc !important;
}

.report-card.featured {
  background: linear-gradient(180deg, rgba(26, 32, 44, 0.95) 0%, rgba(18, 22, 31, 0.98) 100%) !important;
  border: 1.5px solid rgba(245, 158, 11, 0.55) !important;
}

.report-card .report-title {
  color: #ffffff !important;
}

.report-card .report-desc {
  color: #94a3b8 !important;
}

.report-card .report-features li {
  color: #cbd5e1 !important;
}

/* Light Mode Overrides for Sample Reports */
[data-theme="light"] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

[data-theme="light"] .reports-hero .reports-title {
  background: linear-gradient(135deg, #0f172a 30%, #334155 70%, var(--cyber-blue, #0ea5e9) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .reports-subtitle {
  color: #475569 !important;
}

[data-theme="light"] .reports-advisory-box {
  background: #ffffff !important;
  border-color: rgba(14, 165, 233, 0.3) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .advisory-title {
  color: #0f172a !important;
}

[data-theme="light"] .advisory-text {
  color: #475569 !important;
}

[data-theme="light"] .report-card,
[data-theme="light"] .case-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

[data-theme="light"] .report-card.featured {
  background: #ffffff !important;
  border: 1.5px solid rgba(245, 158, 11, 0.6) !important;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.12) !important;
}

[data-theme="light"] .report-card .report-title {
  color: #0f172a !important;
}

[data-theme="light"] .report-card .report-desc {
  color: #475569 !important;
}

[data-theme="light"] .report-card .report-features li {
  color: #334155 !important;
}

/* --- Contact Page Light Mode --- */
[data-theme="light"] .form-label {
  color: #1e293b !important;
}
[data-theme="light"] .form-hint {
  color: #64748b !important;
}
[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] .form-textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}
[data-theme="light"] .form-input::placeholder,
[data-theme="light"] .form-textarea::placeholder {
  color: #94a3b8 !important;
}
[data-theme="light"] .form-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}
[data-theme="light"] .info-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.03) !important;
}
[data-theme="light"] .info-card-title {
  color: #0f172a !important;
}
[data-theme="light"] .info-card-desc {
  color: #475569 !important;
}
[data-theme="light"] #submitBtn {
  background: #0284c7 !important;
  color: #ffffff !important;
  border: none !important;
}
[data-theme="light"] #submitBtn:hover {
  background: #0369a1 !important;
}

/* --- Sample Reports Light Mode Enhancements --- */
[data-theme="light"] .navbar {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}
[data-theme="light"] .nav-links a {
  color: #334155 !important;
}
[data-theme="light"] .nav-links a:hover {
  color: #0284c7 !important;
}
[data-theme="light"] .cases-section {
  background: #f1f5f9 !important;
}
[data-theme="light"] .case-card h3,
[data-theme="light"] .case-title {
  color: #0f172a !important;
}
[data-theme="light"] .case-card p,
[data-theme="light"] .case-desc {
  color: #475569 !important;
}
[data-theme="light"] .cta-banner {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}
[data-theme="light"] .cta-banner h2 {
  color: #0f172a !important;
}
[data-theme="light"] .cta-banner .cta-lead {
  color: #475569 !important;
}
[data-theme="light"] .site-footer,
[data-theme="light"] footer {
  background: #f8fafc !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  color: #475569 !important;
}
[data-theme="light"] .footer-disclaimer,
[data-theme="light"] .footer-meta {
  color: #64748b !important;
}

/* --- Verify Page Light Mode --- */
[data-theme="light"] .verify-box {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}
[data-theme="light"] .verify-title {
  color: #0f172a !important;
}
[data-theme="light"] .verify-desc {
  color: #475569 !important;
}
[data-theme="light"] .phone-notice-box {
  background: #f0fdf4 !important;
  border: 1px solid rgba(16, 185, 129, 0.35) !important;
  color: #166534 !important;
}
[data-theme="light"] .verify-badge {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: rgba(2, 132, 199, 0.25) !important;
  color: #0284c7 !important;
}

/* --- Legal Pages Light Mode --- */
[data-theme="light"] .legal-nav { background: rgba(255, 255, 255, 0.94) !important; border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important; }
[data-theme="light"] .legal-wrapper { background: #f8fafc !important; }
[data-theme="light"] .legal-card { background: #ffffff !important; border: 1px solid rgba(0, 0, 0, 0.08) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important; color: #1e293b !important; }
[data-theme="light"] .legal-title,
[data-theme="light"] .legal-section h2,
[data-theme="light"] .legal-section h3 { color: #0f172a !important; }
[data-theme="light"] .legal-section p,
[data-theme="light"] .legal-section li { color: #334155 !important; }
[data-theme="light"] .legal-meta { color: #64748b !important; }
[data-theme="light"] .legal-callout { background: #f1f5f9 !important; border-color: rgba(0, 0, 0, 0.12) !important; color: #1e293b !important; }
[data-theme="light"] .legal-callout.warning { background: #fffbeb !important; border-color: rgba(245, 158, 11, 0.4) !important; color: #92400e !important; }
[data-theme="light"] .legal-callout.emerald { background: #f0fdf4 !important; border-color: rgba(16, 185, 129, 0.4) !important; color: #166534 !important; }
[data-theme="light"] .btn-back-home { background: #f1f5f9 !important; border-color: rgba(0, 0, 0, 0.1) !important; color: #0f172a !important; }
[data-theme="light"] .btn-back-home:hover { background: #e2e8f0 !important; }
[data-theme="light"] .legal-footer { background: #f8fafc !important; border-top: 1px solid rgba(0, 0, 0, 0.08) !important; color: #64748b !important; }
[data-theme="light"] .legal-footer-links a { color: #475569 !important; }
[data-theme="light"] .legal-footer-links a:hover { color: #0284c7 !important; }
