/* === Variables === */
:root {
  --primary: #6366f1;
  --primary-light: #e0e7ff;
  --primary-dark: #4338ca;
  --bg: #fafbfc;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1120px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* === Layout === */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1rem; }
.container-narrow { max-width: 720px; }

/* === Header === */
.site-header { position: sticky; top: 0; background: rgba(250,251,252,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 100; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.125rem; }
.logo-mark { object-fit: contain; flex-shrink: 0; }
.main-nav { display: flex; gap: 1.5rem; }
.main-nav a { font-size: 0.875rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.main-nav a:hover, .main-nav a.active { color: var(--primary); }
.mobile-toggle { display: none; background: none; border: none; cursor: pointer; width: 28px; height: 20px; position: relative; }
.mobile-toggle span { display: block; width: 100%; height: 2px; background: var(--text); position: absolute; left: 0; transition: 0.3s; }
.mobile-toggle span:nth-child(1) { top: 0; }
.mobile-toggle span:nth-child(2) { top: 9px; }
.mobile-toggle span:nth-child(3) { top: 18px; }

/* === Hero === */
.hero { padding: 5rem 0 4rem; }
.hero .container { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: 2.75rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.gradient-text { background: linear-gradient(135deg, var(--primary), #a855f7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 1.125rem; color: var(--text-muted); margin-top: 1rem; max-width: 460px; }
.hero-actions { margin-top: 2rem; display: flex; gap: 0.75rem; }

/* Hero visual */
.hero-visual { display: flex; justify-content: center; }
.hero-card { background: #1e1e2e; border-radius: var(--radius); padding: 1.5rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.hero-card .dots { display: flex; gap: 6px; margin-bottom: 1.25rem; }
.hero-card .dots span { width: 10px; height: 10px; border-radius: 50%; }
.hero-card .dots span:nth-child(1) { background: #ff5f57; }
.hero-card .dots span:nth-child(2) { background: #febc2e; }
.hero-card .dots span:nth-child(3) { background: #28c840; }
.code-lines { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.875rem; line-height: 1.8; color: #cdd6f4; }
.code-lines .kw { color: #cba6f7; }
.code-lines .fn { color: #89b4fa; }
.code-lines .comment { color: #585b70; }

/* Homepage hero */
.home-hero { padding: 5rem 0 4rem; background: linear-gradient(160deg, #f0f1ff 0%, #fafbfc 60%); }
.hero-logo { width: 56px; height: 56px; margin-bottom: 1.5rem; object-fit: contain; }
.hero-phone { max-width: 300px; width: 100%; filter: drop-shadow(0 20px 50px rgba(0,0,0,0.15)); }

/* === Buttons === */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.625rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 600; transition: all 0.2s; border: none; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.3); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }

/* === Sections === */
.section-title { font-size: 1.75rem; font-weight: 700; text-align: center; margin-bottom: 0.5rem; }
.section-subtitle { text-align: center; color: var(--text-muted); margin-bottom: 2.5rem; }

/* === Apps Section === */
.apps-section { padding: 4rem 0; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
.app-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: box-shadow 0.2s, transform 0.2s; }
.app-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.app-card-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.app-icon img { width: 40px; height: 40px; border-radius: 10px; }
.app-card h3 { font-size: 1.125rem; font-weight: 600; }
.app-version, .app-version-badge { font-size: 0.75rem; color: var(--text-muted); background: var(--primary-light); color: var(--primary); padding: 0.125rem 0.5rem; border-radius: 99px; font-weight: 500; }
.app-card > p { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 1rem; }
.app-platforms { display: flex; gap: 0.375rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.platform-badge { font-size: 0.75rem; padding: 0.25rem 0.625rem; background: var(--bg); border: 1px solid var(--border); border-radius: 99px; color: var(--text-muted); text-transform: capitalize; }

/* === App Detail Page === */
.app-hero { padding: 4rem 0 3rem; text-align: center; }
.app-hero-icon { margin: 0 auto 1.5rem; }
.app-hero h1 { font-size: 2.25rem; margin-bottom: 0.5rem; }
.app-hero-tagline { font-size: 1.125rem; color: var(--text-muted); max-width: 520px; margin: 0 auto; }
.app-meta { display: flex; justify-content: center; gap: 0.5rem; margin: 1.25rem 0 2rem; flex-wrap: wrap; }

.app-about { padding: 3rem 0; }
.app-description { font-size: 1.0625rem; color: var(--text-muted); max-width: 680px; margin: 0 auto; text-align: center; line-height: 1.7; }

.app-features { padding: 3rem 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; max-width: 900px; margin: 0 auto; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.feature-icon { width: 40px; height: 40px; background: var(--primary-light); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; margin-bottom: 0.75rem; }
.feature-card h3 { font-size: 0.9375rem; font-weight: 600; margin-bottom: 0.375rem; }
.feature-card p { font-size: 0.875rem; color: var(--text-muted); }

.app-screenshots { padding: 3rem 0; }
.screenshots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.screenshot-item { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.screenshot-item img { width: 100%; }

/* === Legal === */
.legal-page { padding: 4rem 0; }
.legal-header { margin-bottom: 2rem; }
.legal-header h1 { font-size: 2rem; }
.legal-date { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.legal-content { line-height: 1.8; color: var(--text); }
.legal-content h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; font-weight: 600; }
.legal-content h3 { font-size: 1.0625rem; margin: 1.5rem 0 0.5rem; font-weight: 600; }
.legal-content p { margin-bottom: 0.75rem; }
.legal-content ul { margin: 0.5rem 0 1rem 1.5rem; }
.legal-content li { margin-bottom: 0.375rem; }
.legal-content strong { font-weight: 600; }

/* === CTA Section === */
.cta-section { padding: 4rem 0; text-align: center; background: linear-gradient(135deg, var(--primary-light), #f0e6ff); border-radius: var(--radius); margin: 2rem auto; max-width: var(--max-width); }
.cta-section h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.cta-section p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* === Footer === */
.site-footer { border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-brand .logo { margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.875rem; color: var(--text-muted); }
.footer-links h4 { font-size: 0.8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.75rem; }
.footer-links a { display: block; font-size: 0.875rem; color: var(--text-muted); padding: 0.25rem 0; transition: color 0.2s; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 2rem; padding-top: 1rem; text-align: center; }
.footer-bottom p { font-size: 0.8125rem; color: var(--text-muted); }

/* === Error === */
.error-page { padding: 6rem 1rem; text-align: center; }

/* === Mobile === */
@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .main-nav { position: fixed; top: 64px; left: 0; right: 0; background: var(--bg-card); flex-direction: column; padding: 1rem; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateY(-120%); transition: transform 0.3s; z-index: 99; }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 0.5rem 0; }
  .hero .container { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { font-size: 2rem; }
  .hero-subtitle { margin: 1rem auto 0; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-card { max-width: 320px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .apps-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
}

/* === Admin === */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: #1e1e2e; color: #cdd6f4; padding: 1.5rem 0; position: fixed; height: 100vh; overflow-y: auto; }
.admin-sidebar .logo { color: #fff; padding: 0 1.25rem; margin-bottom: 2rem; }
.admin-sidebar nav a { display: flex; align-items: center; gap: 0.625rem; padding: 0.625rem 1.25rem; color: #9ca3af; font-size: 0.875rem; transition: all 0.2s; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.06); color: #fff; }
.admin-sidebar nav a svg { width: 18px; height: 18px; opacity: 0.7; }
.admin-main { flex: 1; margin-left: 240px; padding: 2rem; background: var(--bg); min-height: 100vh; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.5rem; }

/* Admin Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.stat-card .stat-label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; margin-top: 0.25rem; }

/* Admin Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.625rem 0.875rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 0.875rem; background: var(--bg-card); transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary); }
.form-group textarea { min-height: 200px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.admin-table th, .admin-table td { padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; }
.admin-table th { background: var(--bg); font-weight: 600; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.admin-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.admin-table .actions { display: flex; gap: 0.5rem; }

/* Admin Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 1.375rem; text-align: center; margin-bottom: 1.5rem; }
.login-card .logo { justify-content: center; margin-bottom: 1.5rem; }
.alert { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }

/* === Language Switcher === */
.lang-switcher { position: relative; display: flex; align-items: center; }
.lang-btn { display: flex; align-items: center; gap: 0.375rem; background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.375rem 0.625rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.lang-btn:hover { border-color: var(--primary); color: var(--primary); }
.lang-dropdown { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 140px; z-index: 200; overflow: hidden; }
.lang-switcher:hover .lang-dropdown,
.lang-switcher:focus-within .lang-dropdown { display: block; }
.lang-option { display: block; padding: 0.5rem 0.875rem; font-size: 0.875rem; color: var(--text-muted); transition: background 0.15s, color 0.15s; }
.lang-option:hover { background: var(--bg); color: var(--text); }
.lang-option.active { color: var(--primary); font-weight: 600; background: var(--primary-light); }

/* === Section layout === */
.section { padding: 5rem 0; }
.section-alt { background: #f5f5fb; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header .section-title { margin-bottom: 0.75rem; }
.section-header .section-subtitle { max-width: 600px; margin: 0 auto; color: var(--text-muted); }

/* === App Hero (full page) === */
.app-hero { padding: 4.5rem 0 2rem; background: linear-gradient(160deg, #f0f1ff 0%, #fafbfc 60%); }
.app-hero-content { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.app-hero-badge { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.app-hero-badge img { border-radius: 16px; box-shadow: 0 4px 16px rgba(99,102,241,0.2); }
.app-hero-badge h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem; }
.app-hero-tagline { color: var(--primary); font-weight: 600; font-size: 0.9375rem; }
.app-hero-subtitle { font-size: 1.0625rem; color: var(--text-muted); line-height: 1.7; margin-bottom: 2rem; }
.app-free-note { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.75rem; }

/* Hero phone mockup */
.app-hero-screens { position: relative; display: flex; justify-content: center; }
.app-hero-phone { max-width: 320px; width: 100%; filter: drop-shadow(0 20px 50px rgba(0,0,0,0.18)); }
.app-screenshot-phone.app-hero-phone-wrap {
  width: 270px;
  filter: drop-shadow(0 20px 50px rgba(0,0,0,0.18));
}
.app-screenshot-phone.app-hero-phone-wrap .app-screenshot-shot {
  border-radius: 36px;
}

/* Download buttons */
.app-download-btns { display: flex; gap: 0.875rem; flex-wrap: wrap; }
.store-btn { display: flex; align-items: center; gap: 0.625rem; padding: 0.75rem 1.25rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border); color: var(--text); font-weight: 500; transition: all 0.2s; background: var(--bg-card); }
.store-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow); }
.store-btn-apple { border-color: #000; color: #000; }
.store-btn-apple:hover { background: #000; color: #fff; border-color: #000; }
.store-btn-google:hover { border-color: #34a853; color: #34a853; }
.store-btn-sub { display: block; font-size: 0.8125rem; }

/* === Screenshots grid === */
.app-about-section { padding: 3rem 0 1rem; }
.app-about-container { max-width: 46rem; }
.app-about-text p { font-size: 1.05rem; line-height: 1.7; color: var(--text-muted, #555); margin: 0 0 1.1rem; }
.app-about-text p:last-child { margin-bottom: 0; }

.app-screenshots-section { padding: 4rem 0; }

.app-screenshot-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto 2.25rem;
}
.app-screenshot-countries {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  background: var(--bg-alt, #f3f4f8);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.screenshot-country-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 1rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.screenshot-country-btn:hover {
  color: var(--text);
}
.screenshot-country-btn.active {
  background: #fff;
  color: var(--primary, #4f46e5);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.screenshot-country-flag {
  font-size: 1.05rem;
  line-height: 1;
}
.app-screenshot-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.screenshot-lang-btn {
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.screenshot-lang-btn:hover {
  border-color: var(--primary, #4f46e5);
  color: var(--primary, #4f46e5);
}
.screenshot-lang-btn.active {
  background: var(--primary, #4f46e5);
  border-color: var(--primary, #4f46e5);
  color: #fff;
  font-weight: 600;
}

.app-screenshot-stage { display: flex; align-items: center; gap: 1rem; }
.app-screenshot-viewport { flex: 1; min-width: 0; overflow: hidden; }

.app-screenshot-item { display: none; align-items: center; gap: 2.5rem; }
.app-screenshot-item.active { display: flex; animation: screenshotFadeIn 0.35s ease; }
@keyframes screenshotFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.app-screenshot-phone {
  position: relative;
  flex: 0 0 auto;
  width: 220px;
  aspect-ratio: 389 / 800;
}
.app-screenshot-frame-img { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.app-screenshot-shot {
  position: absolute;
  top: 1.8%;
  left: 4.6%;
  width: 90.8%;
  height: 96.3%;
  object-fit: cover;
  border-radius: 30px;
  background: #000;
  z-index: 1;
}

.app-screenshot-text { flex: 1; min-width: 0; }
.app-screenshot-index { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.03em; color: #2563eb; background: rgba(37, 99, 235, 0.1); border-radius: 999px; padding: 0.2rem 0.7rem; margin-bottom: 0.75rem; }
.app-screenshot-text h3 { font-size: 1.4rem; font-weight: 700; margin: 0 0 0.6rem; color: var(--text, #111); }
.app-screenshot-text p { font-size: 1rem; color: var(--text-muted, #666); margin: 0; line-height: 1.55; max-width: 32rem; }

.carousel-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text, #111);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.15s, transform 0.15s;
}
.carousel-arrow:hover { background: var(--bg-alt, #f3f4f6); transform: scale(1.05); }
.carousel-arrow:active { transform: scale(0.96); }

.app-screenshots-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.carousel-dot { width: 8px; height: 8px; border-radius: 50%; border: none; padding: 0; background: var(--border); cursor: pointer; transition: background 0.15s, transform 0.15s; }
.carousel-dot.active { background: #2563eb; transform: scale(1.25); }

/* === Features grid === */
.app-features-section .features-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); max-width: 100%; }
.feature-card { padding: 1.5rem; }
.feature-icon { color: var(--primary); }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin: 0.75rem 0 0.375rem; }
.feature-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.65; }

/* === Countries grid === */
.countries-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.country-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; gap: 1rem; align-items: flex-start; transition: box-shadow 0.2s, transform 0.2s; }
.country-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.country-flag { font-size: 2.5rem; line-height: 1; flex-shrink: 0; }
.country-info h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 0.25rem; }
.country-exam-badge { display: inline-block; font-size: 0.75rem; padding: 0.2rem 0.6rem; background: var(--primary-light); color: var(--primary); border-radius: 99px; font-weight: 500; margin-bottom: 0.75rem; }
.country-info ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.country-info li { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; color: var(--text-muted); }
.country-info li svg { flex-shrink: 0; margin-top: 2px; color: var(--primary); }

/* === SRC grid === */
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.src-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; display: flex; gap: 1rem; align-items: flex-start; }
.src-number { width: 40px; height: 40px; background: var(--primary); color: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.125rem; font-weight: 700; flex-shrink: 0; }
.src-content h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.src-content h3 span { display: block; font-size: 0.8125rem; color: var(--primary); font-weight: 500; }
.src-content p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; margin-top: 0.5rem; }

/* === Download CTA === */
.app-cta-section { padding: 5rem 0; }
.app-cta-box { background: linear-gradient(135deg, var(--primary), #7c3aed); border-radius: 20px; padding: 4rem 2rem; text-align: center; color: #fff; max-width: 700px; margin: 0 auto; }
.app-cta-box h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; }
.app-cta-box p { font-size: 1.0625rem; opacity: 0.88; margin-bottom: 2rem; }
.app-cta-box .store-btn { border-color: rgba(255,255,255,0.4); color: #fff; background: rgba(255,255,255,0.12); backdrop-filter: blur(8px); }
.app-cta-box .store-btn:hover { background: rgba(255,255,255,0.22); border-color: rgba(255,255,255,0.7); color: #fff; transform: translateY(-1px); }
.app-cta-icon { margin-bottom: 1.25rem; display: flex; justify-content: center; }
.app-cta-icon img { border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.app-cta-box .app-download-btns { justify-content: center; }

/* === RTL support === */
[dir="rtl"] .main-nav { flex-direction: row-reverse; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .app-hero-content { direction: rtl; }
[dir="rtl"] .country-card,
[dir="rtl"] .src-card { flex-direction: row-reverse; }
[dir="rtl"] .country-info li { flex-direction: row-reverse; }
[dir="rtl"] .footer-grid { direction: rtl; }

/* App showcase mobile */
@media (max-width: 900px) {
  .app-hero-content { grid-template-columns: 1fr; }
  .app-hero-screens { margin-top: 2rem; order: -1; }
  .app-hero-phone { max-width: 240px; }
}
@media (max-width: 600px) {
  .app-screenshot-item.active { flex-direction: column; text-align: center; gap: 1.25rem; }
  .app-screenshot-phone { width: 170px; margin: 0 auto; }
  .app-screenshot-text p { max-width: none; }
  .app-screenshot-stage { gap: 0.4rem; }
  .carousel-arrow { width: 36px; height: 36px; }
  .countries-grid, .src-grid { grid-template-columns: 1fr; }
  .app-download-btns { flex-direction: column; }
}

/* === Feature Builder === */
.features-builder { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.feature-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 0.5rem; margin-bottom: 0.5rem; align-items: start; }
.feature-row input { padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.875rem; }
.btn-remove { background: none; border: none; color: #ef4444; cursor: pointer; padding: 0.5rem; font-size: 1.125rem; }

/* Checkbox row */
.checkbox-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.checkbox-row label { display: flex; align-items: center; gap: 0.375rem; font-size: 0.875rem; cursor: pointer; }
.checkbox-row input[type="checkbox"] { width: auto; }

/* Admin mobile */
@media (max-width: 768px) {
  .admin-sidebar { width: 100%; height: auto; position: relative; }
  .admin-main { margin-left: 0; }
  .admin-layout { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; }
}

/* === App legal pages (privacy / terms / delete-account) === */
.app-legal { padding-top: 2.5rem; }
.app-legal-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.app-legal-app { display: inline-flex; align-items: center; gap: 0.625rem; font-weight: 600; }
.app-legal-app img { width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.app-legal-langs { display: flex; gap: 0.375rem; flex-wrap: wrap; }
.app-legal-langs a { font-size: 0.8125rem; padding: 0.25rem 0.625rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text-muted); }
.app-legal-langs a.on, .app-legal-langs a:hover { border-color: var(--primary); color: var(--primary); }
.app-legal-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: -0.75rem 0 2rem; }
.app-legal-tabs a { font-size: 0.875rem; padding: 0.375rem 0.875rem; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); }
.app-legal-tabs a.on { background: var(--primary); color: #fff; }
.legal-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.legal-content ol { margin: 0.5rem 0 1rem 1.5rem; }
.legal-content code { font-size: 0.875em; background: var(--primary-light); padding: 0.1em 0.35em; border-radius: 4px; }
.legal-content hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.legal-note { background: var(--primary-light); border-radius: var(--radius-sm); padding: 0.875rem 1rem; margin: 1rem 0 1.25rem; }
.legal-table { overflow-x: auto; margin: 0.75rem 0 1.25rem; }
.legal-table table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.legal-table th, .legal-table td { text-align: start; padding: 0.5rem 0.625rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.legal-table th { color: var(--text-muted); font-weight: 600; }
.legal-draft-banner { background: #fef3c7; color: #92400e; border-radius: var(--radius-sm); padding: 0.625rem 1rem; font-size: 0.875rem; margin-bottom: 1.25rem; }
[dir="rtl"] .legal-content ul, [dir="rtl"] .legal-content ol { margin: 0.5rem 1.5rem 1rem 0; }

/* === Admin building blocks (used by App Legal Pages and other admin lists) === */
.admin-main .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.admin-main .table-responsive { overflow-x: auto; }
.admin-main .table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-main .table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 600; padding: 0.625rem 0.75rem; border-bottom: 1px solid var(--border); }
.admin-main .table td { padding: 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-main .table tr:last-child td { border-bottom: none; }
.admin-main .badge { display: inline-block; font-size: 0.6875rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); vertical-align: middle; }
.admin-main .btn-secondary { background: var(--primary-light); color: var(--primary-dark); }
.admin-main .btn-secondary:hover { background: #c7d2fe; }
.admin-main .form-control { width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; font-size: 0.875rem; background: #fff; color: var(--text); }
.admin-main .form-control:focus { outline: none; border-color: var(--primary); }
.admin-main code { font-size: 0.8125em; background: #f3f4f6; padding: 0.1em 0.35em; border-radius: 4px; }

/* === Admin login extras + language switch === */
.login-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.login-captcha { display: flex; align-items: center; gap: 0.5rem; }
.login-captcha img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.login-card { position: relative; }
.admin-lang-switch { display: inline-flex; gap: 0.25rem; padding: 0.2rem; border-radius: 999px; background: rgba(255,255,255,0.08); }
.admin-lang-switch a { font-size: 0.75rem; font-weight: 600; padding: 0.25rem 0.625rem; border-radius: 999px; color: rgba(255,255,255,0.7); }
.admin-lang-switch a.on { background: #fff; color: #1a1a2e; }
.login-lang { display: flex; width: max-content; margin: -0.5rem -0.5rem 0.75rem auto; background: #f3f4f6; }
.login-lang a { color: var(--text-muted); }
.login-lang a.on { background: var(--primary); color: #fff; }
.admin-sidebar .admin-lang-switch { margin: 0 1.25rem 0.5rem; }

/* === Blog (public) === */
.blog-hero { padding: 3.5rem 0 1.5rem; text-align: center; }
.blog-hero h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
.blog-hero p { color: var(--text-muted); margin-top: 0.5rem; }
.blog-cats { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.blog-cats a { font-size: 0.875rem; padding: 0.375rem 0.875rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); background: var(--bg-card); }
.blog-cats a.on, .blog-cats a:hover { border-color: var(--primary); color: var(--primary); }
.blog-list { padding: 1.5rem 0 4rem; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.blog-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.blog-card-media { display: block; aspect-ratio: 16 / 9; background: var(--primary-light); overflow: hidden; }
.blog-card-media img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-placeholder { display: grid; place-items: center; height: 100%; font-size: 3rem; font-weight: 700; color: var(--primary); opacity: .5; }
.blog-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.blog-card-title { font-size: 1.125rem; line-height: 1.35; }
.blog-card-title a:hover { color: var(--primary); }
.blog-card-excerpt { color: var(--text-muted); font-size: 0.9375rem; flex: 1; }
.blog-readmore { font-size: 0.875rem; font-weight: 600; color: var(--primary); }
.blog-card-featured { flex-direction: row; margin-bottom: 1.75rem; }
.blog-card-featured .blog-card-media { flex: 1.2; aspect-ratio: auto; min-height: 280px; }
.blog-card-featured .blog-card-body { flex: 1; padding: 2rem; justify-content: center; }
.blog-card-featured .blog-card-title { font-size: 1.625rem; }
@media (max-width: 760px) { .blog-card-featured { flex-direction: column; } .blog-card-featured .blog-card-media { min-height: 0; aspect-ratio: 16/9; } .blog-card-featured .blog-card-body { padding: 1.25rem; } }
.blog-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.8125rem; color: var(--text-muted); }
.blog-chip { background: var(--primary-light); color: var(--primary-dark); padding: 0.125rem 0.625rem; border-radius: 999px; font-weight: 600; font-size: 0.75rem; }
.blog-empty { text-align: center; color: var(--text-muted); padding: 3rem 0; }
.blog-pager { display: flex; justify-content: space-between; align-items: center; margin-top: 2.5rem; font-size: 0.9375rem; }
.blog-pager a { color: var(--primary); font-weight: 600; }
.blog-rss { text-align: center; margin-top: 2rem; font-size: 0.8125rem; } .blog-rss a { color: var(--text-muted); }
.blog-post { padding: 2.5rem 0 1rem; }
.blog-back { display: inline-block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.blog-post-title { font-size: 2.375rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0.75rem 0; }
.blog-post-lead { font-size: 1.1875rem; color: var(--text-muted); line-height: 1.6; }
.blog-post-langs { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.75rem; } .blog-post-langs a { color: var(--primary); margin-left: 0.375rem; }
.blog-post-cover { margin: 2rem auto; max-width: 960px; } .blog-post-cover img { width: 100%; border-radius: var(--radius); }
.blog-content { font-size: 1.0625rem; margin-top: 1.5rem; }
.blog-content img { max-width: 100%; border-radius: var(--radius-sm); }
.blog-content figure { margin: 1.5rem 0; } .blog-content figcaption { font-size: 0.8125rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.blog-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0 1rem; } .blog-tags a { font-size: 0.8125rem; color: var(--text-muted); background: #f3f4f6; padding: 0.25rem 0.625rem; border-radius: 6px; }
.blog-app-cta { display: flex; align-items: center; gap: 1rem; border: 1px solid var(--border); background: var(--bg-card); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 2rem 0; }
.blog-app-cta img { border-radius: 12px; } .blog-app-cta small { color: var(--text-muted); } .blog-app-cta-go { margin-left: auto; color: var(--primary); font-size: 1.25rem; }
.blog-related h2 { font-size: 1.375rem; margin-bottom: 1.25rem; }
@media (max-width: 640px) { .blog-post-title { font-size: 1.875rem; } .blog-hero h1 { font-size: 1.875rem; } }

/* === Blog (admin) === */
.admin-flash { background: #dcfce7; color: #166534; border-radius: 8px; padding: 0.75rem 1rem; margin-bottom: 1rem; font-size: 0.875rem; }
.admin-flash-error { background: #fee2e2; color: #991b1b; }
.blog-admin-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 0.75rem; padding: 1rem; }
@media (max-width: 800px) { .blog-admin-filters { grid-template-columns: 1fr; } }
.admin-main .badge.blog-state-published { background: #dcfce7; color: #166534; }
.admin-main .badge.blog-state-scheduled { background: #e0f2fe; color: #075985; }
.admin-main .badge.blog-state-draft { background: #fef3c7; color: #92400e; }
.blog-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.blog-editor-side { display: grid; gap: 1rem; position: sticky; top: 1rem; }
@media (max-width: 1100px) { .blog-editor-grid { grid-template-columns: 1fr; } .blog-editor-side { position: static; } }
.blog-lang-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--border); }
.blog-lang-tab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.5rem 0.75rem; font: inherit; font-size: 0.875rem; color: var(--text-muted); cursor: pointer; }
.blog-lang-tab.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.blog-lang-tab.has::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #16a34a; margin-left: 6px; vertical-align: middle; }
.blog-toolbar { display: flex; gap: 0.25rem; align-items: center; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 0.375rem; background: #f9fafb; }
.blog-toolbar button { border: 1px solid transparent; background: none; border-radius: 6px; padding: 0.25rem 0.5rem; font: inherit; font-size: 0.8125rem; cursor: pointer; min-width: 30px; }
.blog-toolbar button:hover { background: #fff; border-color: var(--border); }
.blog-toolbar-hint { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); }
.blog-toolbar + textarea { border-top-left-radius: 0; border-top-right-radius: 0; font-family: 'SF Mono', ui-monospace, monospace; font-size: 0.875rem; line-height: 1.6; }
.blog-checks { display: grid; gap: 0.375rem; max-height: 220px; overflow: auto; }
.blog-checks label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.875rem; font-weight: 400; }
.admin-main .blog-checks label, .admin-main .form-group label:has(> input[type="checkbox"]) { display: flex; gap: 0.5rem; align-items: center; font-weight: 400; }
.admin-main input[type="checkbox"], .admin-main input[type="radio"] { width: auto; flex: none; margin: 0; }

/* === School licences (admin + school page) === */
.org-muted { color: var(--text-muted); }
.org-meter { height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden; width: 120px; margin-bottom: 4px; }
.org-meter span { display: block; height: 100%; background: var(--primary); }
.org-lic, .org-st { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.125rem 0.5rem; border-radius: 999px; }
.org-lic-active, .org-st-active { background: #dcfce7; color: #166534; }
.org-lic-upcoming, .org-st-unused { background: #e0f2fe; color: #075985; }
.org-lic-expired, .org-st-released { background: #f3f4f6; color: #4b5563; }
.org-lic-suspended, .org-st-revoked { background: #fee2e2; color: #991b1b; }
.org-codes-bar { display: grid; grid-template-columns: minmax(0,1fr) 220px auto; gap: 0.75rem; margin-bottom: 1rem; align-items: center; }
@media (max-width: 760px) { .org-codes-bar { grid-template-columns: 1fr; } }
.org-code { white-space: nowrap; font-size: 0.875rem; letter-spacing: 0.04em; background: #eef0ff !important; padding: 0.2em 0.45em !important; }
.org-label-form { display: flex; gap: 0.375rem; min-width: 190px; }
.org-label-form .form-control { padding: 0.375rem 0.5rem; }
.org-codes-table td { vertical-align: middle; }
.org-portal-link { display: flex; gap: 0.5rem; }
.org-portal-link .form-control { font-family: ui-monospace, monospace; font-size: 0.8125rem; }
.school-portal { margin: 0 auto !important; max-width: 1100px; padding: 1.5rem 1rem 3rem; }
.school-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.school-brand { display: flex; gap: 0.75rem; align-items: center; } .school-brand img { border-radius: 10px; } .school-brand small { color: var(--text-muted); }
.school-name { font-size: 1.75rem; margin-bottom: 0.25rem; }
.school-portal .stats-grid { margin: 1.5rem 0; }
.school-howto { margin-bottom: 1.5rem; } .school-howto h3 { margin-bottom: 0.75rem; } .school-howto ol { padding-left: 1.25rem; margin-bottom: 0.75rem; line-height: 1.7; }
