:root {
  --ivory: #FAF6ED;
  --paper: #FFFDF8;
  --ink: #191713;
  --muted: #6E6459;
  --line: #E3D9C8;
  --terra: #B54B32;
  --terra-dark: #8C3520;
  --green: #1E4A3C;
  --green-dark: #14352B;
  --gold: #C9A227;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --radius: 18px;
  --shadow: 0 24px 60px -32px rgba(30, 53, 43, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html[dir="rtl"] body {
  font-family: 'Cairo', var(--font-body);
  font-size: 17px;
  line-height: 1.8;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 {
  font-family: 'Cairo', var(--font-display);
  letter-spacing: 0;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--terra);
}

img,
svg {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--terra);
  outline-offset: 3px;
  border-radius: 4px;
}

.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 24px;
}

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

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  background: var(--green);
  color: var(--ivory);
  padding: 10px 16px;
  border-radius: 8px;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 12px;
  color: var(--ivory);
}

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 237, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 74px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--green);
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--green);
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-text span {
  color: var(--terra);
}

.beta-pill {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 3px 8px;
  line-height: 1.2;
  align-self: flex-start;
  margin-top: 2px;
}

html[dir="rtl"] .beta-pill {
  letter-spacing: 0;
}

html[dir="rtl"] .brand-text {
  font-family: 'Cairo', sans-serif;
  font-size: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-inline-start: 8px;
}

.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--green);
  border-bottom-color: var(--terra);
}

.header-actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
}

.lang-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: 999px;
  line-height: 1.3;
}

.lang-link:hover {
  color: var(--ink);
}

.lang-link.is-active {
  background: var(--green);
  color: var(--ivory);
}

html[dir="rtl"] .lang-link {
  font-family: 'Cairo', sans-serif;
}

.mobile-menu {
  display: none;
  position: relative;
  margin-inline-start: auto;
}

.mobile-menu summary {
  list-style: none;
  cursor: pointer;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 20px;
}

.mobile-menu summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-panel {
  position: absolute;
  inset-inline-end: 0;
  top: 52px;
  width: 240px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: grid;
  gap: 2px;
}

.mobile-menu-panel a,
.mobile-menu-panel button {
  display: block;
  width: 100%;
  text-align: start;
  padding: 10px 12px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
}

.mobile-menu-panel a:hover,
.mobile-menu-panel button:hover {
  background: var(--ivory);
}

.mobile-langs {
  padding: 8px 6px 4px;
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}

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

.btn-primary {
  background: var(--green);
  color: var(--ivory);
}

.btn-primary:hover {
  background: var(--green-dark);
  color: var(--ivory);
}

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

.btn-ghost:hover {
  background: rgba(30, 74, 60, 0.07);
  color: var(--green);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: var(--ivory);
}

.btn-danger {
  background: transparent;
  color: var(--terra);
  border-color: var(--terra);
}

.btn-danger:hover {
  background: var(--terra);
  color: #fff;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Hero ─────────────────────────────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%231E4A3C' stroke-opacity='0.075' stroke-width='1'%3E%3Cpath d='M70 0l70 70-70 70L0 70z'/%3E%3Cpath d='M70 24l46 46-46 46-46-46z'/%3E%3Ccircle cx='70' cy='70' r='12'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 85%);
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 85%);
  pointer-events: none;
}

html[dir="rtl"] .hero-pattern {
  mask-image: linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 85%);
  -webkit-mask-image: linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 85%);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  align-items: center;
  gap: 56px;
  padding-block: 76px 88px;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
}

html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
  font-size: 13px;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 4.25rem);
  margin: 0 0 22px;
  max-width: 13ch;
}

html[dir="rtl"] .hero h1 {
  max-width: 16ch;
}

.hero-sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--muted);
  max-width: 54ch;
  margin-bottom: 28px;
}

.hero-search {
  display: flex;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  max-width: 640px;
  box-shadow: 0 14px 30px -24px rgba(30, 53, 43, 0.5);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.hero-search input:focus {
  outline: none;
}

.hero-search .btn {
  border-radius: 10px;
  padding: 10px 20px;
  flex-shrink: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-fiche {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 24px 20px;
  transform: rotate(-1.2deg);
  max-width: 380px;
  justify-self: end;
}

html[dir="rtl"] .hero-fiche {
  transform: rotate(1.2deg);
  justify-self: start;
}

.fiche-top {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.fiche-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--terra);
  flex-shrink: 0;
}

.fiche-steps {
  list-style: none;
  margin: 16px 0 18px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.fiche-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.35;
}

.fiche-steps span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--green);
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.fiche-foot {
  font-size: 12px;
  color: var(--terra);
  font-weight: 600;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
}

/* ── Trust ────────────────────────────────────────────────── */

.trust-strip {
  background: var(--green);
  color: var(--ivory);
  padding-block: 26px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.trust-grid div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-inline-start: 18px;
  border-inline-start: 1px solid rgba(250, 246, 237, 0.28);
}

.trust-grid strong {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
}

html[dir="rtl"] .trust-grid strong {
  font-family: 'Cairo', sans-serif;
}

.trust-grid span {
  font-size: 13.5px;
  color: rgba(250, 246, 237, 0.78);
}

/* ── Sections ─────────────────────────────────────────────── */

.section {
  padding-block: 78px;
}

.section-alt {
  background: #F4EDDF;
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 720px;
  margin-bottom: 40px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--muted);
  font-size: 16.5px;
  margin: 0;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: #D2C4AC;
  color: var(--ink);
}

.guide-card-emoji {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--ivory);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 23px;
  margin-bottom: 6px;
}

.guide-card-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--terra);
}

.guide-card h3 {
  font-size: 20px;
  margin: 0;
}

.guide-card p {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0 0 8px;
}

.guide-card-more {
  margin-top: auto;
  padding-top: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--green);
}

/* ── How ──────────────────────────────────────────────────── */

.how-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.how-grid li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.how-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--terra);
  display: block;
  margin-bottom: 14px;
}

.how-grid h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.how-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* ── Packs ────────────────────────────────────────────────── */

.pack-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pack-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
}

.pack-card.is-featured {
  background: var(--green);
  color: var(--ivory);
  border-color: var(--green);
  box-shadow: var(--shadow);
}

.pack-card.is-featured .pack-detail {
  color: rgba(250, 246, 237, 0.75);
}

.pack-card.is-featured .btn-outline,
.pack-card.is-featured .btn-primary {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-dark);
}

.pack-badge {
  position: absolute;
  top: -12px;
  inset-inline-start: 24px;
  background: var(--gold);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 999px;
}

.pack-card h3 {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

html[dir="rtl"] .pack-card h3 {
  letter-spacing: 0;
}

.pack-price {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1;
}

html[dir="rtl"] .pack-price {
  font-family: 'Cairo', sans-serif;
}

.pack-detail {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 22px;
}

.pack-card form {
  margin-top: auto;
}

.center-note {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 26px;
}

.pricing-notes {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: grid;
  gap: 6px;
}

.pricing-notes p {
  margin: 0;
  font-size: 14.5px;
}

.pricing-notes .muted {
  color: var(--muted);
}

.pricing-notes .beta-note {
  background: #F4EDDF;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--green-dark);
}

.muted {
  color: var(--muted);
}

/* ── Page head ────────────────────────────────────────────── */

.page-head {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-block: 54px 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%23B54B32' stroke-opacity='0.06' stroke-width='1'%3E%3Cpath d='M80 0l80 80-80 80L0 80z'/%3E%3Ccircle cx='80' cy='80' r='14'/%3E%3C/g%3E%3C/svg%3E");
}

.page-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 12px;
}

.page-head .lead {
  color: var(--muted);
  font-size: 17px;
  max-width: 62ch;
  margin: 0 0 20px;
}

.results-note {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

/* ── Guide ────────────────────────────────────────────────── */

.guide-hero {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding-block: 28px 46px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
}

.crumbs a {
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--green);
}

.guide-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 48px;
  align-items: start;
}

.guide-emoji-lg {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--ivory);
  border: 1px solid var(--line);
  font-size: 30px;
  margin-bottom: 18px;
}

.guide-hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  margin-bottom: 14px;
}

.guide-hero .lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 50ch;
  margin-bottom: 12px;
}

.audience {
  font-size: 14px;
  color: var(--ink);
  background: #F4EDDF;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  display: inline-block;
  margin: 0;
}

.review-note {
  font-size: 12.5px;
  color: var(--terra);
  margin-top: 12px;
  margin-bottom: 0;
}

.ask-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.ask-card h2 {
  font-size: 21px;
  margin-bottom: 8px;
}

.ask-card > p {
  font-size: 14px;
  color: var(--muted);
}

.ask-form {
  display: grid;
  gap: 10px;
}

.ask-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 120px;
  background: #fff;
  color: var(--ink);
}

.ask-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 74, 60, 0.12);
}

.ask-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin: 2px 0 0;
}

.ask-status {
  font-size: 13.5px;
  min-height: 0;
}

.ask-status.is-error {
  color: var(--terra);
}

.ask-status a {
  font-weight: 600;
}

.answer-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.answer-box h3 {
  font-size: 17px;
  margin-bottom: 10px;
}

.answer-content {
  font-size: 14px;
  line-height: 1.65;
}

.answer-content p {
  margin: 0 0 10px;
}

.answer-content ul,
.answer-content ol {
  padding-inline-start: 20px;
  margin: 0 0 10px;
}

.answer-content h4 {
  font-family: var(--font-body);
  font-size: 14px;
  margin: 12px 0 6px;
}

.answer-note {
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  margin-top: 12px;
}

.guide-layout {
  padding-block: 48px 84px;
}

.guide-main {
  max-width: 860px;
}

.intro-block {
  font-size: 18px;
  line-height: 1.7;
  border-inline-start: 3px solid var(--terra);
  padding-inline-start: 22px;
  margin-bottom: 40px;
}

.intro-block h2 {
  font-size: 13px;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

html[dir="rtl"] .intro-block h2 {
  letter-spacing: 0;
}

.intro-block p:last-child {
  margin-bottom: 0;
}

.guide-section {
  margin-bottom: 48px;
}

.guide-section h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  margin-bottom: 20px;
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips li {
  font-size: 13.5px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  padding-block: 20px;
  border-top: 1px solid var(--line);
}

.steps li:first-child {
  border-top: 0;
  padding-top: 0;
}

.step-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--terra);
  line-height: 1;
}

.step-body h3 {
  font-size: 18.5px;
  margin-bottom: 6px;
}

.step-body p {
  margin: 0 0 8px;
  color: #3D3730;
  font-size: 15.5px;
}

.step-tip {
  background: #F4EDDF;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px !important;
  color: var(--ink) !important;
  margin-top: 10px !important;
}

.step-tip strong {
  color: var(--terra);
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.checklist li {
  position: relative;
  padding-inline-start: 32px;
  font-size: 15.5px;
}

.checklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--green);
  border-radius: 5px;
  background: linear-gradient(135deg, transparent 55%, rgba(30, 74, 60, 0.08));
}

.template-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.template {
  background: #F7F1E5;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 540px;
  overflow-y: auto;
  unicode-bidi: plaintext;
  text-align: start;
  margin: 0;
}

html[dir="rtl"] .template {
  font-family: 'Cairo', ui-monospace, monospace;
  font-size: 15px;
}

.institution-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.institution {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}

.institution h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.institution p {
  font-size: 14px;
  color: #3D3730;
  margin: 0 0 6px;
}

.institution .where {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0;
}

.guide-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.plain-list {
  margin: 0;
  padding-inline-start: 20px;
  display: grid;
  gap: 8px;
  font-size: 15px;
}

.callout {
  background: var(--green);
  color: var(--ivory);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.callout h2 {
  color: var(--ivory);
  font-size: 20px;
  margin-bottom: 10px;
}

.callout p {
  color: rgba(250, 246, 237, 0.88);
  margin: 0;
}

.faq-item {
  border-bottom: 1px solid var(--line);
  padding-block: 4px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15.5px;
  padding-block: 14px;
  list-style: none;
  position: relative;
  padding-inline-end: 28px;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  inset-inline-end: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--terra);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0 0 16px;
  color: #3D3730;
  font-size: 15px;
}

.guide-end {
  margin-top: 56px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.guide-end h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.guide-end p {
  color: var(--muted);
}

/* ── Auth ─────────────────────────────────────────────────── */

.auth-body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' stroke='%231E4A3C' stroke-opacity='0.05' stroke-width='1'%3E%3Cpath d='M80 0l80 80-80 80L0 80z'/%3E%3C/g%3E%3C/svg%3E");
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 64px 20px 90px;
  min-height: 60vh;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 30px;
  margin-bottom: 14px;
}

.auth-note {
  background: #F4EDDF;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--green-dark);
}

.form-error {
  background: #FBEDE9;
  border: 1px solid #E8C3B8;
  color: var(--terra-dark);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 74, 60, 0.12);
}

.auth-switch {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.auth-terms {
  margin: 18px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

/* ── Account ──────────────────────────────────────────────── */

.account-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.credits-card {
  background: var(--green);
  color: var(--ivory);
  border-radius: 20px;
  padding: 28px;
  display: grid;
  gap: 6px;
  position: sticky;
  top: 96px;
}

.credits-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(250, 246, 237, 0.7);
}

html[dir="rtl"] .credits-label {
  letter-spacing: 0;
}

.credits-number {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  margin-bottom: 14px;
}

html[dir="rtl"] .credits-number {
  font-family: 'Cairo', sans-serif;
}

.credits-card .btn {
  background: var(--gold);
  color: var(--green-dark);
}

.account-main {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.panel h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.danger-panel {
  border-color: #E8C3B8;
}

.history-item {
  border-bottom: 1px solid var(--line);
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item summary {
  cursor: pointer;
  display: flex;
  gap: 14px;
  align-items: baseline;
  padding-block: 12px;
  list-style: none;
}

.history-item summary::-webkit-details-marker {
  display: none;
}

.history-date {
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
  min-width: 88px;
}

.history-q {
  font-size: 14.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-body {
  padding: 4px 0 16px;
  font-size: 14.5px;
}

.history-body p {
  margin: 0 0 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: start;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.data-table th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: grid;
  gap: 4px;
}

.stat span {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat strong {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.admin-grant {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.admin-grant label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.admin-grant input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
  min-width: 220px;
}

.admin-grant input[type="number"] {
  min-width: 110px;
  width: 110px;
}

.flash-ok {
  color: var(--green);
  font-weight: 600;
  font-size: 14px;
}

html[dir="rtl"] .stat strong {
  font-family: 'Cairo', sans-serif;
}

.legal-text {
  max-width: 760px;
}

.legal-text h2 {
  font-size: 21px;
  margin-top: 32px;
}

.legal-text p {
  color: #3D3730;
  font-size: 15.5px;
}

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  background: var(--green-dark);
  color: var(--ivory);
  padding-block: 54px 24px;
  margin-top: 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-brand .brand-mark {
  color: var(--gold);
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.footer-brand .brand-text {
  color: var(--ivory);
}

.footer-brand p {
  color: rgba(250, 246, 237, 0.68);
  font-size: 13.5px;
  max-width: 44ch;
  margin-top: 8px;
}

.footer-col {
  display: grid;
  gap: 8px;
  align-content: start;
}

.footer-col h3 {
  font-family: var(--font-body);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 4px;
}

.footer-col a {
  color: rgba(250, 246, 237, 0.8);
  text-decoration: none;
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--ivory);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(250, 246, 237, 0.16);
  margin-top: 40px;
  padding-top: 18px;
  font-size: 12px;
  color: rgba(250, 246, 237, 0.55);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 1020px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-block: 56px 64px;
  }

  .hero-fiche {
    justify-self: start;
    max-width: 420px;
  }

  html[dir="rtl"] .hero-fiche {
    justify-self: end;
  }

  .guide-hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .ask-card {
    position: static;
  }

  .guide-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .credits-card {
    position: static;
  }
}

@media (max-width: 880px) {
  .main-nav,
  .header-actions {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .trust-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .trust-grid div {
    border-inline-start: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
  }

  .pack-grid,
  .how-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .shell {
    padding-inline: 18px;
  }

  .header-inner {
    min-height: 64px;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 10vw, 2.8rem);
  }

  .hero-search {
    flex-direction: column;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .hero-search input {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 13px 14px;
  }

  .hero-search .btn {
    width: 100%;
    border-radius: 12px;
    padding: 13px 18px;
  }

  .hero-fiche {
    transform: none;
  }

  html[dir="rtl"] .hero-fiche {
    transform: none;
  }

  .section {
    padding-block: 54px;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }

  .steps li {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 12px;
  }

  .step-num {
    font-size: 22px;
  }

  .institution-grid,
  .guide-two-col {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .guide-layout {
    padding-block: 32px 56px;
  }

  .intro-block {
    font-size: 16.5px;
    padding-inline-start: 16px;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-bottom {
    justify-content: flex-start;
  }

  .guide-end {
    padding: 22px;
  }

  .history-item summary {
    flex-direction: column;
    gap: 2px;
  }

  .history-q {
    white-space: normal;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .ask-card,
  .template-actions,
  .guide-end,
  .mobile-menu,
  .hero-search {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .guide-layout {
    padding: 0;
  }

  .template {
    max-height: none;
    border: 1px solid #ccc;
  }
}
