/* ========================================
   Digital Iran Freedom Congress — Styles
   Matched to Jomhoor.org / Rarimo design system (light theme)
   ======================================== */

:root {
  --bg-primary: #F5F7FA;
  --bg-secondary: #EBEEF2;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F0F2F5;
  --bg-elevated: #FFFFFF;

  --text-primary: rgba(0, 0, 0, 0.87);
  --text-secondary: rgba(0, 0, 0, 0.6);
  --text-muted: rgba(0, 0, 0, 0.56);

  --accent-primary: #3B82F6;
  --accent-secondary: #0EA5E9;
  --accent-gradient: linear-gradient(87.63deg, #3B82F6 -1.41%, #0EA5E9 113.73%);
  --accent-gradient-soft: linear-gradient(87.63deg, rgba(59, 130, 246, 0.10), rgba(14, 165, 233, 0.10));

  --success: #059669;
  --error: #DC2626;

  --border-color: rgba(0, 0, 0, 0.08);
  --border-accent: rgba(59, 130, 246, 0.3);

  --component-primary: rgba(0, 0, 0, 0.04);
  --component-hovered: rgba(0, 0, 0, 0.07);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 60px rgba(59, 130, 246, 0.08);

  --bg-gradient: linear-gradient(259.67deg, #BFDBFE 7.71%, #BAE6FD 42.6%, #F5F7FA 91.86%);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --max-width: 1200px;
  --container-padding: 24px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-fa: 'Parastoo', 'Vazirmatn', 'Inter', sans-serif;
  --font-ku: 'Vazirmatn', 'Inter', sans-serif;
}

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

/* ─── Planning Banner ─── */
.planning-banner {
  background: var(--accent-gradient);
  color: #fff;
  text-align: center;
  padding: 10px var(--container-padding);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 999;
}

.planning-banner a {
  color: #fff;
  text-decoration: underline;
  font-weight: 600;
}

.planning-banner a:hover {
  text-decoration: none;
}

[dir="rtl"] .planning-banner {
  letter-spacing: 0;
}

/* ─── Skip link ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 12px 24px;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
  color: #fff;
}

/* ─── Focus indicators ─── */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

body[dir="rtl"] {
  font-family: var(--font-fa);
}

/* Persian text inside LTR pages */
[lang="fa"] {
  font-family: var(--font-fa);
}

/* Other Arabic-script languages inside LTR pages */
[lang="ckb"],
[lang="ar"],
[lang="bal"],
[lang="az"] {
  font-family: var(--font-ku);
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-primary); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ========================================
   Navigation
   ======================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all var(--transition);
  background: rgba(245, 247, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}
nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
nav .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.02em;
}
nav .logo .diamond {
  font-size: 1.2rem;
  color: #F59E0B;
  filter: drop-shadow(0 0 6px #F59E0B);
  text-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}
nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  align-items: center;
}
nav ul li a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  white-space: nowrap;
}
nav ul li a:hover,
nav ul li a.active { color: var(--text-primary); }

.lang-switch {
  display: flex;
  gap: .5rem;
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  padding-left: 16px;
}
[dir="rtl"] .lang-switch {
  border-left: none;
  border-right: 1px solid rgba(0, 0, 0, 0.12);
  padding-left: 0;
  padding-right: 16px;
}
.lang-switch a {
  padding: .25rem .6rem;
  border-radius: 100px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  border: none;
  transition: color var(--transition);
}
.lang-switch a.active,
.lang-switch a:hover {
  background: var(--accent-gradient);
  color: #fff;
  -webkit-background-clip: padding-box;
}

/* ─── Mobile nav ─── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 1.5rem;
  color: var(--text-primary);
}
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: rgba(245, 247, 250, 0.98);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    gap: .75rem;
  }
  nav ul.open { display: flex; }
  .lang-switch { border-left: none; padding-left: 0; }
  [dir="rtl"] .lang-switch { border-right: none; padding-right: 0; }
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 158px 0 80px;
  overflow: hidden;
  background: var(--bg-gradient);
  text-align: center;
}
.hero .container {
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 0 60px rgba(59, 130, 246, 0.1), 0 0 120px rgba(14, 165, 233, 0.05);
}
.hero .subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}
.hero .cta-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 64px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
  color: #ffffff;
}
.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: var(--component-hovered);
}

/* ========================================
   Sections
   ======================================== */
section { padding: 120px 0; }
section:nth-child(even) { background: var(--bg-secondary); }

.section-label {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 14px rgba(59, 130, 246, 0.2));
}
[dir="rtl"] .section-label {
  letter-spacing: normal;
  text-transform: none;
}

section h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 0 36px rgba(59, 130, 246, 0.12), 0 0 72px rgba(14, 165, 233, 0.05);
}

section h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: .5rem;
  letter-spacing: -0.01em;
}

section p, section li {
  color: var(--text-secondary);
  max-width: 720px;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* ─── Section header centered layout ─── */
#working-groups .container > .section-label,
#working-groups .container > h2,
#working-groups .container > p,
#governance .container > .section-label,
#governance .container > h2,
#governance .container > p,
#redlines .container > .section-label,
#redlines .container > h2,
#redlines .container > p,
#rhythm .container > .section-label,
#rhythm .container > h2,
#rhythm .container > p,
#partners .container > .section-label,
#partners .container > h2,
#roadmap .container > .section-label,
#roadmap .container > h2 {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ========================================
   Stats
   ======================================== */
.stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}
.stat { text-align: center; }
.stat .number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.stat .label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========================================
   Cards
   ======================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 2rem;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition);
}
.card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.card:hover::before {
  opacity: 1;
}
.card h3 { margin-bottom: .5rem; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card h3 i[data-lucide] { flex-shrink: 0; width: 24px; height: 24px; color: var(--accent-secondary); }
.card h3 .subtitle-fa {
  display: block;
  width: 100%;
  font-size: 0.875em;
  font-weight: 500;
  color: var(--text-secondary);
}
.card p { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.6; }
.card .tag {
  display: inline-block;
  margin-top: .75rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 100px;
  color: var(--accent-primary);
}

/* ========================================
   Table
   ======================================== */
.table-wrap { overflow-x: auto; margin-top: 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .75rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
th { font-weight: 600; background: var(--bg-secondary); white-space: nowrap; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }

/* ========================================
   Timeline
   ======================================== */
.timeline { position: relative; padding-left: 2rem; margin-top: 2rem; }
.timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent-gradient); }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before { content: ''; position: absolute; left: -2rem; top: .35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-gradient); border: 2px solid var(--bg-primary); }
.timeline-item h3 { margin-bottom: .25rem; }
.timeline-item p { font-size: 0.9375rem; }

[dir="rtl"] .timeline { padding-left: 0; padding-right: 2rem; }
[dir="rtl"] .timeline::before { left: auto; right: 0; }
[dir="rtl"] .timeline-item::before { left: auto; right: -2rem; }

/* ========================================
   Quote Block
   ======================================== */
.quote-block {
  background: var(--accent-gradient-soft);
  border-left: 3px solid var(--accent-primary);
  padding: 1.5rem 2rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
  font-style: italic;
}
[dir="rtl"] .quote-block {
  border-left: none;
  border-right: 3px solid var(--accent-primary);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.quote-block .attribution {
  display: block;
  margin-top: .75rem;
  font-style: normal;
  font-weight: 600;
  font-size: .85rem;
  color: var(--accent-primary);
}

/* ========================================
   Footer
   ======================================== */
footer {
  background: #111111;
  color: rgba(255, 255, 255, 0.56);
  padding: 80px 0 40px;
  font-size: .88rem;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}
footer a { color: var(--accent-secondary); transition: color var(--transition); }
footer a:hover { color: #fff; }
footer .footer-col h4 {
  color: rgba(255, 255, 255, 0.9);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  margin-bottom: .75rem;
}
footer .footer-col ul { list-style: none; }
footer .footer-col ul li { margin-bottom: .4rem; }
footer .copyright {
  width: 100%;
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: .8rem;
  color: rgba(255, 255, 255, 0.44);
}

/* ========================================
   Utility
   ======================================== */
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }

/* ========================================
   Red-line list
   ======================================== */
.redlines li {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-color);
}
.redlines li:last-child { border-bottom: none; }
.redlines .icon-yes { color: var(--success); margin-right: .5rem; display: inline-flex; vertical-align: middle; }
.redlines .icon-no { color: var(--error); margin-right: .5rem; display: inline-flex; vertical-align: middle; }
.redlines .icon-yes svg, .redlines .icon-no svg { width: 16px; height: 16px; }
[dir="rtl"] .redlines .icon-yes,
[dir="rtl"] .redlines .icon-no { margin-right: 0; margin-left: .5rem; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .hero { min-height: auto; padding: 100px 0 60px; }
  section { padding: 80px 0; }
}
@media (max-width: 640px) {
  .hero { padding: 80px 0 40px; }
  .hero h1 { font-size: clamp(2rem, 8vw, 2.5rem); }
  section { padding: 60px 0; }
  .stats { gap: 1.5rem; }
  .container { padding: 0 1.25rem; }
}

/* ========================================
   Signup Form + Counter
   ======================================== */
.signup-section {
  text-align: center;
}
.signup-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient-soft);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  padding: 8px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 32px;
}
.signup-counter .count-number {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1.125rem;
}
.signup-form {
  display: flex;
  gap: 12px;
  max-width: 440px;
  margin: 0 auto 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.signup-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: 12px 20px;
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.9375rem;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.signup-form input[type="email"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.signup-form input[type="email"]::placeholder {
  color: var(--text-muted);
}
[dir="rtl"] .signup-form input[type="email"] {
  text-align: right;
}
.signup-form button {
  padding: 12px 28px;
  border-radius: 100px;
  border: none;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.signup-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}
.signup-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.signup-message {
  font-size: 0.875rem;
  min-height: 1.4em;
  margin-top: 8px;
}
.signup-message.success { color: var(--success); }
.signup-message.error { color: var(--error); }

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
}
