/* ================================================
   PAGINI LEGALE - distribuirepliante.ro
   Typography premium pentru documente legale lungi
   ================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #1A1A2E;
  background: #FAFAFA;
  -webkit-font-smoothing: antialiased;
}

:root {
  --primary: #FF5A1F;
  --primary-dark: #D91E36;
  --ink: #1A1A2E;
  --ink-soft: #2D2D44;
  --slate: #5A5A73;
  --cloud: #E5E5EC;
  --snow: #F5F5F8;
  --gold: #D4AF37;
}

/* === TOPBAR + HEADER (compact pentru legal pages) === */
.legal-topbar {
  background: var(--ink);
  color: white;
  padding: 8px 0;
  font-size: 0.8rem;
}

.legal-topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.legal-topbar a {
  color: white;
  text-decoration: none;
  margin-right: 16px;
}

.legal-topbar a:hover { color: var(--primary); }

.legal-header {
  background: white;
  border-bottom: 1px solid var(--cloud);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26, 26, 46, 0.04);
}

.legal-header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.legal-logo-mark {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #FF5A1F 0%, #D91E36 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
}

.legal-logo-text {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal-logo-text .accent { color: var(--primary); }

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--snow);
  border: 1px solid var(--cloud);
  border-radius: 100px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.legal-back:hover {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

/* === HERO === */
.legal-hero {
  background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
  color: white;
  padding: 60px 0 50px;
  position: relative;
  overflow: hidden;
}

.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 90, 31, 0.15) 0%, transparent 50%);
}

.legal-hero-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.legal-breadcrumb {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 16px;
}

.legal-breadcrumb a {
  color: rgba(255, 122, 71, 0.9);
  text-decoration: none;
}

.legal-breadcrumb a:hover { text-decoration: underline; }

.legal-eyebrow {
  display: inline-block;
  padding: 5px 14px;
  background: linear-gradient(135deg, #FF5A1F 0%, #D91E36 100%);
  color: white;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.legal-hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.1;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.legal-hero p {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
}

.legal-meta {
  display: flex;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
}

.legal-meta span { display: inline-flex; align-items: center; gap: 6px; }
.legal-meta strong { color: white; font-weight: 600; }

/* === BODY === */
.legal-body {
  background: white;
  padding: 60px 0 40px;
}

.legal-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === TABLE OF CONTENTS === */
.legal-toc {
  background: var(--snow);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 24px 28px;
  margin-bottom: 40px;
}

.legal-toc h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.legal-toc h2::before {
  content: '📑';
  font-size: 1.2rem;
}

.legal-toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding-left: 0;
  columns: 2;
  column-gap: 24px;
}

.legal-toc ol li {
  counter-increment: toc-counter;
  padding: 5px 0;
  break-inside: avoid;
  font-size: 0.88rem;
}

.legal-toc ol li::before {
  content: counter(toc-counter) '. ';
  color: var(--primary);
  font-weight: 700;
}

.legal-toc a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.legal-toc a:hover { color: var(--primary); text-decoration: underline; }

/* === SECTIONS === */
.legal-section {
  margin-bottom: 36px;
  scroll-margin-top: 100px;
}

.legal-section h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--cloud);
  position: relative;
}

.legal-section h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #FF5A1F 0%, #D91E36 100%);
}

.legal-section h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin: 24px 0 10px;
  text-transform: uppercase;
}

.legal-section h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 16px 0 8px;
}

.legal-section p {
  font-size: 0.98rem;
  line-height: 1.75;
  color: #2D2D44;
  margin-bottom: 14px;
  text-align: justify;
}

.legal-section p strong { color: var(--ink); font-weight: 700; }

.legal-section ul,
.legal-section ol {
  margin: 12px 0 16px 0;
  padding-left: 0;
  list-style: none;
}

.legal-section ul li,
.legal-section ol li {
  font-size: 0.96rem;
  line-height: 1.7;
  color: #2D2D44;
  margin-bottom: 8px;
  padding-left: 26px;
  position: relative;
}

.legal-section ul li::before {
  content: '▸';
  position: absolute;
  left: 8px;
  top: 0;
  color: var(--primary);
  font-weight: 800;
}

.legal-section ol {
  counter-reset: ol-counter;
}

.legal-section ol li {
  counter-increment: ol-counter;
}

.legal-section ol li::before {
  content: counter(ol-counter, lower-alpha) ')';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.92rem;
}

/* === ARTICOL (legal article numbering) === */
.legal-article {
  margin-bottom: 22px;
  padding-left: 0;
}

.legal-article-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin-right: 6px;
}

/* === DEFINITION TABLE === */
.legal-definitions {
  background: var(--snow);
  border-radius: 12px;
  padding: 24px 28px;
  margin: 20px 0;
  border: 1px solid var(--cloud);
}

.legal-definitions dl {
  margin: 0;
}

.legal-definitions dt {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 16px;
  margin-bottom: 4px;
}

.legal-definitions dt:first-child { margin-top: 0; }

.legal-definitions dd {
  margin: 0 0 12px 0;
  padding: 0;
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* === CALLOUT BOXES === */
.legal-callout {
  display: flex;
  gap: 14px;
  padding: 18px 22px;
  border-radius: 12px;
  margin: 20px 0;
  align-items: flex-start;
}

.legal-callout-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.legal-callout-content { flex: 1; }
.legal-callout-content strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: var(--ink);
}
.legal-callout-content p {
  margin: 0;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
  color: var(--ink-soft);
}

.legal-callout-info {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.legal-callout-info .legal-callout-icon { background: #3B82F6; color: white; }

.legal-callout-warning {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.legal-callout-warning .legal-callout-icon { background: #F59E0B; color: white; }

.legal-callout-primary {
  background: linear-gradient(135deg, #FFF4EE 0%, #FFE8E0 100%);
  border: 1px solid rgba(255, 90, 31, 0.2);
}
.legal-callout-primary .legal-callout-icon {
  background: linear-gradient(135deg, #FF5A1F 0%, #D91E36 100%);
  color: white;
}

/* === IDENTIFICARE FIRMĂ BOX === */
.legal-identity {
  background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
  color: white;
  border-radius: 16px;
  padding: 28px 32px;
  margin: 24px 0;
  position: relative;
  overflow: hidden;
}

.legal-identity::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 90, 31, 0.2) 0%, transparent 60%);
}

.legal-identity-inner {
  position: relative;
  z-index: 1;
}

.legal-identity h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 10px;
}

.legal-identity .company-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #FF7A47 0%, #FF5A1F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.legal-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.legal-identity-item .label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.legal-identity-item .value {
  font-size: 0.95rem;
  color: white;
  font-weight: 500;
}

.legal-identity-item .value a {
  color: #FF7A47;
  text-decoration: none;
}

.legal-identity-item .value a:hover { text-decoration: underline; }

/* === COOKIE TABLE === */
.cookie-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  font-size: 0.88rem;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.06);
  border: 1px solid var(--cloud);
}

.cookie-table th {
  background: linear-gradient(135deg, #1A1A2E 0%, #2D2D44 100%);
  color: white;
  padding: 12px 14px;
  text-align: left;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
}

.cookie-table td {
  padding: 12px 14px;
  border-top: 1px solid var(--cloud);
  color: var(--ink-soft);
  vertical-align: top;
}

.cookie-table tr:first-child td { border-top: none; }

.cookie-table td:first-child {
  font-weight: 700;
  color: var(--ink);
}

.badge-essential { background: #10B981; color: white; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; }
.badge-functional { background: #3B82F6; color: white; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; }
.badge-analytics { background: #F59E0B; color: white; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; }
.badge-marketing { background: var(--primary); color: white; padding: 3px 8px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; }

/* === LEGAL FOOTER === */
.legal-footer {
  background: var(--ink);
  color: white;
  padding: 50px 0 24px;
  margin-top: 60px;
}

.legal-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.legal-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.legal-footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 16px 0;
  max-width: 360px;
}

.legal-footer h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 14px;
}

.legal-footer ul { list-style: none; }
.legal-footer ul li { margin-bottom: 8px; }
.legal-footer ul li a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.legal-footer ul li a:hover { color: var(--primary); }

.legal-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
}

.legal-footer-bottom a {
  color: rgba(255, 122, 71, 0.85);
  text-decoration: none;
}
.legal-footer-bottom a:hover { text-decoration: underline; }

/* === BACK TO TOP === */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #FF5A1F 0%, #D91E36 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 90, 31, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 50;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(255, 90, 31, 0.5);
}

/* === PRINT === */
@media print {
  .legal-topbar, .legal-header, .legal-back, .back-to-top, .legal-toc { display: none; }
  .legal-hero { background: white; color: black; padding: 20px 0; }
  .legal-hero h1, .legal-hero p, .legal-breadcrumb { color: black; }
  .legal-body { padding: 0; }
  .legal-section h2 { color: black; border-color: black; }
  .legal-section p, .legal-section li { color: black; font-size: 11pt; }
  .legal-identity { background: white; color: black; border: 1px solid black; }
  .legal-identity .company-name { color: black; }
  .legal-identity-item .label, .legal-identity-item .value { color: black; }
  body { font-size: 11pt; }
}

/* === RESPONSIVE === */
@media (max-width: 720px) {
  .legal-hero { padding: 40px 0 36px; }
  .legal-body { padding: 40px 0 30px; }
  .legal-toc ol { columns: 1; }
  .legal-identity-grid { grid-template-columns: 1fr; }
  .legal-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .legal-section h2 { font-size: 1.3rem; }
  .legal-content { padding: 0 16px; }
  .legal-section p { font-size: 0.95rem; text-align: left; }
  .cookie-table { font-size: 0.8rem; }
  .cookie-table th, .cookie-table td { padding: 9px 10px; }
}

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