/* Alfifa unified site — theme tokens taken from alfifa.co */
:root {
  --primary: #815EA6;
  --primary-dark: #654784;
  --primary-light: #f3eff7;
  --text-main: #2b2233;
  --text-muted: #6b5c77;
  --bg-body: #fcfbfc;
  --bg-card: #ffffff;
  --border-color: #e6dfef;
  --brand-red: #a8322d;          /* from the logo mark */
  --ok: #2f7d4f;
  --ok-bg: #eaf6ef;
  --warn-bg: #fff6e5;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(43, 34, 51, .04), 0 4px 16px rgba(101, 71, 132, .06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text-main);
  background: var(--bg-body);
}
[dir="rtl"] body { line-height: 1.8; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; color: var(--text-main); }
h1 { font-size: clamp(1.75rem, 4vw, 2.2rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; color: var(--primary); }
p { margin: 0 0 1em; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.section { padding-block: 56px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section-head p { color: var(--text-muted); }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 16px; top: 8px; z-index: 100; background: #fff; padding: 8px 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.4em; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(129, 94, 166, .25); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border-color); }
.btn-outline:hover { border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--primary); padding-inline: .6em; }
.btn-sm { padding: .45em .9em; font-size: .85rem; }
.btn-block { width: 100%; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.logo img { height: 46px; width: auto; display: block; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav a { color: var(--text-main); font-weight: 600; padding: .5em .75em; border-radius: var(--radius-sm); }
.main-nav a:hover, .main-nav a.active { color: var(--primary); background: var(--primary-light); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-link { border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: .35em .8em; font-size: .85rem; color: var(--primary); }
.menu-toggle { display: none; background: none; border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 8px 10px; cursor: pointer; color: var(--text-main); }
.menu-toggle svg { display: block; }

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; inset-inline: 0; top: 100%; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--border-color); padding: 8px 16px 16px; gap: 2px; }
  .main-nav.open { display: flex; }
  .site-header .wrap { justify-content: space-between; position: relative; }
  .header-actions .btn-outline { display: none; }
  .logo img { height: 40px; }
}

/* Hero */
.hero { padding-block: 32px 8px; }
.hero-box {
  background: linear-gradient(135deg, var(--primary-light), #fff 70%);
  border: 1px solid var(--border-color); border-radius: 16px;
  padding: clamp(32px, 6vw, 64px) clamp(20px, 5vw, 56px); text-align: center;
}
.hero-box h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: .4em; }
.hero-box p { color: var(--text-muted); max-width: 680px; margin-inline: auto; font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 24px; }

.page-hero { background: linear-gradient(135deg, var(--primary-light), #fff 75%); border-bottom: 1px solid var(--border-color); padding-block: 40px 32px; }
.page-hero p { color: var(--text-muted); max-width: 720px; margin-bottom: 0; }
.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); }

/* Cards & grids */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 24px; }
.card p:last-child { margin-bottom: 0; }
.card-link { display: flex; flex-direction: column; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--primary); box-shadow: var(--shadow); color: inherit; transform: translateY(-2px); }
.card .more { margin-top: auto; padding-top: 12px; font-weight: 600; color: var(--primary); font-size: .9rem; }
.service-card .icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; margin-bottom: 14px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .2em .7em; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-muted { background: #f2f0f4; color: var(--text-muted); }

/* Steps */
.steps { counter-reset: step; }
.step { position: relative; padding-inline-start: 56px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; inset-inline-start: 0; top: 0; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 700; display: grid; place-items: center;
}
.step h3 { color: var(--text-main); font-size: 1.05rem; margin-bottom: .3em; }

/* Countries */
.country-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.flag { width: 40px; height: 30px; border-radius: 4px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); flex: none; }
.flag-lg { width: 64px; height: 48px; border-radius: 6px; }
.country-card .name { font-weight: 700; color: var(--text-main); }
.country-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--border-color); background: #fff; border-radius: 999px; padding: .4em 1em; font: inherit; font-size: .85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Visa type panels */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 16px 0 20px; }
.fact { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: 12px 14px; }
.fact .label { font-size: .78rem; color: var(--text-muted); display: block; }
.fact .value { font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { position: relative; padding-inline-start: 28px; }
.checklist li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: .35em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23815EA6' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.visa-type + .visa-type { margin-top: 20px; }
.visa-type header { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.visa-type header h2 { font-size: 1.25rem; margin: 0; }
.notice { border-radius: var(--radius-sm); padding: 12px 16px; background: var(--warn-bg); border: 1px solid #f3e2bf; font-size: .9rem; }
.notice-info { background: var(--primary-light); border-color: var(--border-color); }
.notice-ok { background: var(--ok-bg); border-color: #cfe9da; color: #1f5a37; }

/* Two-column page layout */
.layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
.sticky { position: sticky; top: 92px; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .sticky { position: static; } }

/* Tables */
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 16px; text-align: start; border-bottom: 1px solid var(--border-color); }
.table th { background: var(--primary-light); font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Forms */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; font: inherit; color: var(--text-main); background: #fff;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm); padding: .65em .85em;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(129, 94, 166, .15); }
.textarea { min-height: 140px; resize: vertical; }
.error { color: #b42318; font-size: .82rem; margin-top: 4px; }
.hp { position: absolute; inset-inline-start: -9999px; }
.search { position: relative; flex: 1; max-width: 360px; min-width: 220px; }
.search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search .input { padding-inline-start: 38px; }

/* FAQ */
details.faq { background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius); padding: 0 18px; }
details.faq + details.faq { margin-top: 10px; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; color: var(--primary); font-weight: 700; font-size: 1.2rem; line-height: 1; }
details.faq[open] summary::after { content: "–"; }
details.faq .answer { padding-bottom: 16px; color: var(--text-muted); }

/* Prose (CMS pages) */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.35rem; margin-top: 1.6em; }
.prose ul { padding-inline-start: 1.2em; }
.prose li { margin-bottom: .4em; }

/* Footer */
.site-footer { background: #fff; border-top: 1px solid var(--border-color); margin-top: 56px; padding-block: 40px 24px; color: var(--text-muted); font-size: .88rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 2fr 1fr 1fr; }
.footer-grid h4 { color: var(--text-main); font-size: .95rem; margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--text-muted); }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border-color); margin-top: 28px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

.flash { margin-bottom: 16px; }
[x-cloak] { display: none !important; }

/* Fixes: country cards stay in a row; step numbers sit inside cards */
.card-link.country-card { flex-direction: row; }
.card.step { padding-inline-start: 76px; }
.card.step::before { top: 22px; inset-inline-start: 22px; }

/* Accounts */
.auth-card { padding: 32px 28px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; overflow-x: auto; }
.tabs a { padding: 10px 16px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active, .tabs a:hover { color: var(--primary); border-bottom-color: var(--primary); }
.select { appearance: auto; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination .page-link { display: block; padding: 6px 12px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: #fff; }
.pagination .active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled .page-link { color: var(--text-muted); }
.main-nav .nav-auth { display: none; }
@media (max-width: 960px) { .main-nav .nav-auth { display: block; color: var(--primary); border-top: 1px solid var(--border-color); margin-top: 6px; padding-top: 12px; } }
