/* ============================================================
   PLISE PERDE — DESIGN SYSTEM v1.0
   Design Tokens | Typography | Spacing | Components
   ============================================================ */

/* ── 1. DESIGN TOKENS ───────────────────────────────────────── */
:root {
  /* Brand Colors */
  --color-primary:        #83bd81;
  --color-primary-dark:   #6aab68;
  --color-primary-light:  #a8d4a6;
  --color-primary-xlight: #e8f5e8;

  --color-dark:           #404e5e;
  --color-dark-80:        #5a6a7a;
  --color-dark-60:        #7a8a9a;
  --color-dark-20:        #d0d8e0;
  --color-dark-10:        #eef1f4;

  --color-white:          #ffffff;
  --color-bg:             #fafbfc;
  --color-surface:        #ffffff;

  --color-text-primary:   #1a2330;
  --color-text-secondary: #404e5e;
  --color-text-muted:     #6b7a8d;
  --color-text-light:     #98a8b8;

  --color-border:         #dde3ea;
  --color-border-light:   #eef1f4;

  --color-success:        #83bd81;
  --color-error:          #e05c5c;
  --color-warning:        #f0a030;

  /* Typography Scale — Inter */
  --font-family:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:            'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:    0.75rem;    /* 12px */
  --text-sm:    0.875rem;   /* 14px */
  --text-base:  1rem;       /* 16px */
  --text-md:    1.125rem;   /* 18px */
  --text-lg:    1.25rem;    /* 20px */
  --text-xl:    1.5rem;     /* 24px */
  --text-2xl:   1.875rem;   /* 30px */
  --text-3xl:   2.25rem;    /* 36px */
  --text-4xl:   3rem;       /* 48px */
  --text-5xl:   3.75rem;    /* 60px */

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;

  --lh-tight:   1.2;
  --lh-snug:    1.35;
  --lh-normal:  1.6;
  --lh-relaxed: 1.75;

  --ls-tight:   -0.03em;
  --ls-snug:    -0.02em;
  --ls-normal:   0;
  --ls-wide:     0.02em;
  --ls-wider:    0.08em;

  /* Spacing Scale (4px base) */
  --sp-1:   0.25rem;   /* 4px  */
  --sp-2:   0.5rem;    /* 8px  */
  --sp-3:   0.75rem;   /* 12px */
  --sp-4:   1rem;      /* 16px */
  --sp-5:   1.25rem;   /* 20px */
  --sp-6:   1.5rem;    /* 24px */
  --sp-8:   2rem;      /* 32px */
  --sp-10:  2.5rem;    /* 40px */
  --sp-12:  3rem;      /* 48px */
  --sp-16:  4rem;      /* 64px */
  --sp-20:  5rem;      /* 80px */
  --sp-24:  6rem;      /* 96px */
  --sp-32:  8rem;      /* 128px */

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px 0 rgba(64,78,94,.06);
  --shadow-sm:  0 1px 3px 0 rgba(64,78,94,.1), 0 1px 2px -1px rgba(64,78,94,.1);
  --shadow-md:  0 4px 6px -1px rgba(64,78,94,.1), 0 2px 4px -2px rgba(64,78,94,.1);
  --shadow-lg:  0 10px 15px -3px rgba(64,78,94,.1), 0 4px 6px -4px rgba(64,78,94,.1);
  --shadow-xl:  0 20px 25px -5px rgba(64,78,94,.1), 0 8px 10px -6px rgba(64,78,94,.1);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   200ms ease;
  --transition-slow:   300ms ease;

  /* Container */
  --container-sm:   640px;
  --container-md:   768px;
  --container-lg:   1024px;
  --container-xl:   1280px;
  --container-2xl:  1440px;

  /* Z-Index */
  --z-base:    0;
  --z-above:   10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-nav:     300;
  --z-top:     400;
}

/* ── 2. RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* ── 3. TYPOGRAPHY ──────────────────────────────────────────── */
.t-h1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--color-text-primary);
}

.t-h2 {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--color-text-primary);
}

.t-h3 {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-3xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--color-text-primary);
}

.t-h4 {
  font-size: clamp(var(--text-lg), 2vw, var(--text-2xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--color-text-primary);
}

.t-h5 {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--color-text-primary);
}

.t-body-lg {
  font-size: var(--text-md);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text-secondary);
}

.t-body {
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-secondary);
}

.t-small {
  font-size: var(--text-sm);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-muted);
}

.t-caption {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-wide);
  color: var(--color-text-light);
  text-transform: uppercase;
}

.t-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-wide);
  color: var(--color-text-secondary);
}

.t-overline {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  line-height: var(--lh-normal);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: #3d7a3b;
}

/* ── 4. LAYOUT ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

@media (max-width: 640px) {
  .container { padding-inline: var(--sp-4); }
}

@media (min-width: 1440px) {
  .container { max-width: var(--container-2xl); }
}

.section {
  padding-block: var(--sp-20);
}

.section--sm {
  padding-block: var(--sp-12);
}

.section--lg {
  padding-block: var(--sp-32);
}

@media (max-width: 768px) {
  .section     { padding-block: var(--sp-12); }
  .section--sm { padding-block: var(--sp-8); }
  .section--lg { padding-block: var(--sp-16); }
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-2   { gap: var(--sp-2); }
.flex-gap-3   { gap: var(--sp-3); }
.flex-gap-4   { gap: var(--sp-4); }

/* ── 5. BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 48px;
  padding-inline: var(--sp-6);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  line-height: 1;
  letter-spacing: 0.01em;
  transition: background-color var(--transition-base),
              border-color var(--transition-base),
              color var(--transition-base),
              box-shadow var(--transition-base),
              transform var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.btn--primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.btn--secondary:hover {
  background-color: var(--color-primary-xlight);
  box-shadow: var(--shadow-sm);
}

.btn--ghost {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

.btn--ghost:hover {
  background-color: var(--color-dark-10);
  border-color: var(--color-dark-20);
}

.btn--dark {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
  color: var(--color-white);
}

.btn--dark:hover {
  background-color: var(--color-text-primary);
  box-shadow: var(--shadow-md);
}

.btn--sm {
  height: 38px;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

.btn--lg {
  height: 56px;
  padding-inline: var(--sp-8);
  font-size: var(--text-md);
  border-radius: var(--radius-xl);
}

.btn--icon {
  width: 48px;
  padding-inline: 0;
  border-radius: var(--radius-full);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── 6. CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card--flat {
  box-shadow: none;
}

.card--flat:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
  flex-shrink: 0;
}

.card__icon svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary-dark);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--color-text-primary);
  margin-bottom: var(--sp-2);
}

.card__desc {
  font-size: var(--text-sm);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
}

/* ── 7. BADGE ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 24px;
  padding-inline: var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
}

.badge--primary {
  background: var(--color-primary-xlight);
  color: var(--color-primary-dark);
}

.badge--dark {
  background: var(--color-dark-10);
  color: var(--color-dark);
}

.badge--white {
  background: rgba(255,255,255,0.15);
  color: var(--color-white);
  border: 1px solid rgba(255,255,255,0.25);
}

/* ── 8. SECTION HEADER ─────────────────────────────────────── */
.section-header {
  text-align: center;
  max-width: 680px;
  margin-inline: auto;
  margin-bottom: var(--sp-12);
}

.section-header .t-overline {
  margin-bottom: var(--sp-3);
}

.section-header .t-h2 {
  margin-bottom: var(--sp-4);
}

.section-header .t-body-lg {
  margin-bottom: 0;
}

/* ── 9. DIVIDER ────────────────────────────────────────────── */
.divider {
  width: 48px;
  height: 3px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-block: var(--sp-4);
}

.divider--center { margin-inline: auto; }

/* ── 10. TABLES ────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table thead {
  background: var(--color-dark-10);
}

.data-table thead th {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  font-weight: var(--fw-semibold);
  font-size: var(--text-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--color-border-light);
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: var(--color-primary-xlight);
}

.data-table td {
  padding: var(--sp-3) var(--sp-4);
  color: var(--color-text-secondary);
  vertical-align: middle;
}

.data-table td strong {
  color: var(--color-text-primary);
  font-weight: var(--fw-semibold);
}

/* ── 11. ACCORDION ─────────────────────────────────────────── */
.accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.accordion__item {
  border-bottom: 1px solid var(--color-border);
}

.accordion__item:last-child {
  border-bottom: none;
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
  background: var(--color-surface);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  text-align: left;
  border: none;
}

.accordion__trigger:hover {
  background-color: var(--color-dark-10);
}

.accordion__trigger[aria-expanded="true"] {
  color: var(--color-primary-dark);
}

.accordion__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-base);
  color: var(--color-text-muted);
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(180deg);
  color: var(--color-primary-dark);
}

.accordion__panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-slow);
}

.accordion__panel.is-open {
  max-height: 1000px;
}

.accordion__content {
  padding: 0 var(--sp-6) var(--sp-5);
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
}

/* ── 12. ICON SYSTEM ───────────────────────────────────────── */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon--xs  { width: 14px; height: 14px; }
.icon--sm  { width: 18px; height: 18px; }
.icon--md  { width: 24px; height: 24px; }
.icon--lg  { width: 32px; height: 32px; }
.icon--xl  { width: 48px; height: 48px; }

.icon--primary { color: var(--color-primary-dark); }
.icon--dark    { color: var(--color-dark); }
.icon--muted   { color: var(--color-text-muted); }
.icon--white   { color: var(--color-white); }

/* ── 13. LISTS ─────────────────────────────────────────────── */
.list-check {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  list-style: none;
  padding: 0;
}

.list-check li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--lh-normal);
}

.list-check li .check-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--color-primary-xlight);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ── 14. TOOLTIP ───────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-dark);
  color: var(--color-white);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: var(--z-overlay);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ── 15. CONTENT TYPOGRAPHY (Article) ─────────────────────── */
.content h2 {
  font-size: clamp(var(--text-xl), 2.5vw, var(--text-2xl));
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
  color: var(--color-text-primary);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}

.content h3 {
  font-size: clamp(var(--text-lg), 2vw, var(--text-xl));
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  color: var(--color-text-primary);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.content p {
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-4);
}

.content ul, .content ol {
  margin-bottom: var(--sp-5);
  padding-left: var(--sp-6);
}

.content ul { list-style: disc; }
.content ol { list-style: decimal; }

.content li {
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-secondary);
  margin-bottom: var(--sp-2);
  padding-left: var(--sp-1);
}

.content strong {
  font-weight: var(--fw-semibold);
  color: var(--color-text-primary);
}

.content em {
  font-style: italic;
  color: var(--color-dark-80);
}

.content u {
  text-decoration-color: var(--color-primary);
  text-underline-offset: 3px;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-bottom: var(--sp-6);
}

.content table th,
.content table td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--color-border);
  text-align: left;
}

.content table th {
  background: var(--color-dark-10);
  font-weight: var(--fw-semibold);
  font-size: var(--text-xs);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.content table tr:nth-child(even) td {
  background: var(--color-bg);
}

/* ── 16. UTILITY ───────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left   { text-align: left; }

.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mt-8  { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }

.mb-2  { margin-bottom: var(--sp-2); }
.mb-3  { margin-bottom: var(--sp-3); }
.mb-4  { margin-bottom: var(--sp-4); }
.mb-6  { margin-bottom: var(--sp-6); }
.mb-8  { margin-bottom: var(--sp-8); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.no-scroll { overflow: hidden; }

/* ── 17. ANIMATIONS ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeIn   { animation: fadeIn 0.4s ease forwards; }

/* ── 18. FOCUS STYLES ───────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
