/* ==========================================================================
   TEDxAl Kawthar — Official Visual Architecture & Volunteer Recruitment Platform
   Visual Identity: Al Kawthar Nocturnal Atmosphere, River of Ideas & Crimson Pulse
   Features: Dark & Light Mode, Creative Language Gate, Pure SVG Icons, Fluid Animations
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Official Brand Crimson */
  --ted-red: #EB0028;
  --ted-red-hover: #c40021;
  --ted-red-dark: #9e001a;
  --ted-red-glow: rgba(235, 0, 40, 0.45);
  --ted-red-soft: rgba(235, 0, 40, 0.12);

  /* Dark Theme Palette (Default Official TEDx Theme) */
  --bg-base: #06080e;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1a050a 0%, #080b12 55%, #030407 100%);
  --surface-card: rgba(13, 17, 26, 0.85);
  --surface-card-hover: rgba(19, 25, 38, 0.95);
  --surface-subtle: rgba(255, 255, 255, 0.04);
  --surface-elevated: #111622;
  --border-subtle: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(235, 0, 40, 0.5);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --header-bg: rgba(6, 8, 14, 0.88);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-red-glow: 0 0 30px -4px var(--ted-red-glow);

  /* Radius & Typography */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --font-ar: 'Cairo', system-ui, sans-serif;
  --font-en: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-gradient: radial-gradient(circle at 50% 0%, #fff1f3 0%, #f8fafc 50%, #f1f5f9 100%);
  --surface-card: #ffffff;
  --surface-card-hover: #ffffff;
  --surface-subtle: #f1f5f9;
  --surface-elevated: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-hover: rgba(235, 0, 40, 0.6);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --header-bg: rgba(255, 255, 255, 0.92);

  --shadow-sm: 0 1px 4px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px -8px rgba(15, 23, 42, 0.12);
  --shadow-red-glow: 0 4px 20px -2px rgba(235, 0, 40, 0.25);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  min-height: 100vh;
  background-color: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-ar);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body {
  font-family: var(--font-en);
}

::selection {
  background: var(--ted-red);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ted-red);
}

/* SVG Icon Helper */
.icon-svg {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.site-header {
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
  transition: var(--transition);
}

.header-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.brand-logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.brand-logo-dark {
  display: block;
}

.brand-logo-light {
  display: none;
}

[data-theme="light"] .brand-logo-dark {
  display: none;
}

[data-theme="light"] .brand-logo-light {
  display: block;
}

.brand-logo-img:hover {
  transform: scale(1.02);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.header-btn:hover {
  border-color: var(--border-hover);
  background: var(--ted-red-soft);
  color: var(--ted-red);
  transform: translateY(-1px);
}

.theme-toggle-btn {
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  justify-content: center;
}

/* ==========================================================================
   Creative Language Selection Gate (Screen 0)
   ========================================================================== */
.lang-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(26, 5, 10, 0.97) 0%, rgba(6, 8, 14, 0.98) 70%, #020306 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 1rem)) 1rem max(1rem, env(safe-area-inset-bottom, 1rem)) 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 1;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lang-gate-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lang-gate-card {
  max-width: 540px;
  width: 100%;
  margin: auto;
  background: rgba(13, 17, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 45px -10px var(--ted-red-glow);
  position: relative;
  overflow: hidden;
  max-height: calc(100vh - 2rem);
  animation: gateCardEntrance 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes gateCardEntrance {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lang-gate-glow-ring {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 180px;
  background: radial-gradient(circle, var(--ted-red-glow) 0%, transparent 70%);
  pointer-events: none;
}

.lang-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ted-red-soft);
  border: 1px solid rgba(235, 0, 40, 0.35);
  color: var(--ted-red);
  padding: 0.28rem 0.8rem;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-logo-wrapper {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 22px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 1.15rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.lang-gate-logo {
  height: 42px;
  width: auto;
  display: block;
}

.lang-gate-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.lang-gate-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.lang-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.lang-choice-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  font-family: inherit;
  color: inherit;
}

.lang-choice-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--ted-red-soft) 0%, transparent 75%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lang-choice-card:hover, .lang-choice-card:active {
  border-color: var(--ted-red);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -4px rgba(235, 0, 40, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.lang-choice-card:hover::before, .lang-choice-card:active::before {
  opacity: 1;
}

.lang-choice-card:hover .lang-choice-icon, .lang-choice-card:active .lang-choice-icon {
  transform: scale(1.08);
  color: var(--ted-red);
  background: rgba(235, 0, 40, 0.15);
}

.lang-choice-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
  color: #fff;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.lang-choice-info {
  position: relative;
  z-index: 1;
  text-align: center;
}

.lang-choice-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.25rem;
}

.lang-choice-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================================================
   Main Layout & Stepper
   ========================================================================== */
.main-wrapper {
  flex: 1;
  max-width: 1040px;
  width: 100%;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.stepper-nav {
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.stepper-list {
  display: flex;
  justify-content: space-between;
  list-style: none;
  position: relative;
}

.stepper-list::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
}

.step-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--border-subtle);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  transition: var(--transition);
}

.step-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
}

.step-item.active .step-circle {
  background: var(--ted-red);
  border-color: var(--ted-red);
  color: #fff;
  box-shadow: 0 0 0 5px var(--ted-red-soft), 0 0 20px var(--ted-red-glow);
  transform: scale(1.05);
}

.step-item.active .step-title {
  color: var(--ted-red);
  font-weight: 800;
}

.step-item.completed .step-circle {
  background: #10b981;
  border-color: #10b981;
  color: #fff;
}

.step-item.completed .step-title {
  color: #10b981;
}

/* ==========================================================================
   Card Container & Step Panels
   ========================================================================== */
.step-panel {
  display: none;
  animation: panelSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-panel.active {
  display: block;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-container {
  background: var(--surface-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.75rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  position: relative;
}

.section-header {
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--ted-red-soft);
  color: var(--ted-red);
  padding: 0.25rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

/* ==========================================================================
   Screen 1: Intro Cards & Highlights
   ========================================================================== */
.intro-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--ted-red-soft);
  border: 1px solid rgba(235, 0, 40, 0.3);
  color: var(--ted-red);
  padding: 0.4rem 1.1rem;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.intro-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.intro-lead {
  font-size: 1.2rem;
  color: var(--ted-red);
  font-weight: 700;
  max-width: 800px;
  margin: 0 auto 1.25rem;
}

.intro-body-text {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.7;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 2.5rem 0;
}

.highlight-card {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.highlight-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.highlight-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--ted-red-soft);
  color: var(--ted-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.highlight-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

.highlight-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text-main);
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--ted-red);
  background: var(--surface-card);
  box-shadow: 0 0 0 3px var(--ted-red-soft);
}

.form-textarea {
  resize: vertical;
  min-height: 115px;
}

.input-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-hint.warning {
  color: #d97706;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.25);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.error-text {
  color: #ef4444;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.conditional-panel {
  background: var(--surface-subtle);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin: 1.25rem 0 1.5rem;
}

.conditional-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Section 2: Volunteer Teams Cards
   ========================================================================== */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.team-card {
  background: var(--surface-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.team-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.team-card.selected-primary {
  border-color: var(--ted-red);
  background: var(--surface-elevated);
  box-shadow: 0 0 0 2px var(--ted-red), var(--shadow-red-glow);
}

.team-card.selected-alt {
  border-color: #0284c7;
  background: var(--surface-elevated);
  box-shadow: 0 0 0 2px #0284c7;
}

.team-badge-primary {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--ted-red);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
}

html[dir="rtl"] .team-badge-primary {
  right: auto;
  left: 14px;
}

.team-card.selected-primary .team-badge-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.team-badge-alt {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: #0284c7;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
}

html[dir="rtl"] .team-badge-alt {
  right: auto;
  left: 14px;
}

.team-card.selected-alt .team-badge-alt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.team-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ted-red);
  margin-bottom: 1rem;
  transition: var(--transition);
}

.team-card.selected-primary .team-icon-circle {
  background: var(--ted-red);
  color: #fff;
  border-color: var(--ted-red);
}

.team-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.team-description {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.btn-select-team {
  width: 100%;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-select-team.active-primary {
  background: var(--ted-red);
  color: #fff;
  border-color: var(--ted-red);
}

/* ==========================================================================
   Radio Choice Cards
   ========================================================================== */
.radio-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.85rem;
}

.radio-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.15rem;
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.radio-card:hover {
  border-color: var(--border-hover);
}

.radio-card input[type="radio"] {
  accent-color: var(--ted-red);
  width: 18px;
  height: 18px;
}

.radio-card.selected {
  border-color: var(--ted-red);
  background: var(--ted-red-soft);
  box-shadow: 0 0 0 1px var(--ted-red);
}

.radio-card-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   Review & Consent Block
   ========================================================================== */
.review-block {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.review-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.review-block-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-edit-step {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--ted-red);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
}

.btn-edit-step:hover {
  background: var(--ted-red-soft);
  border-color: var(--ted-red);
}

.review-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.review-item {
  display: flex;
  flex-direction: column;
}

.review-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.review-value {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
  word-break: break-word;
}

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--surface-subtle);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-top: 1.75rem;
  cursor: pointer;
}

.checkbox-card input[type="checkbox"] {
  accent-color: var(--ted-red);
  width: 20px;
  height: 20px;
  margin-top: 2px;
}

.checkbox-card-text {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.5;
}

.privacy-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
}

/* ==========================================================================
   Success Screen
   ========================================================================== */
.success-card {
  text-align: center;
  padding: 3.5rem 2rem;
}

.success-badge-icon {
  width: 84px;
  height: 84px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 2px solid #10b981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.25);
  animation: pulseSuccess 2s infinite;
}

@keyframes pulseSuccess {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.success-title {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.ref-code-box {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 520px;
  margin: 2rem auto;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(56, 189, 248, 0.15);
}

.ref-code-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.ref-code-value {
  font-family: monospace;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #38bdf8;
  margin-bottom: 1.25rem;
}

.btn-copy-ref {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-copy-ref:hover {
  background: var(--ted-red);
  border-color: var(--ted-red);
}

.important-box {
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.3);
  color: #f59e0b;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  max-width: 620px;
  margin: 0 auto 2rem;
  font-size: 0.92rem;
  text-align: right;
  line-height: 1.6;
}

html[dir="ltr"] .important-box {
  text-align: left;
}

/* ==========================================================================
   Buttons & Actions
   ========================================================================== */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.85rem;
  font-size: 1rem;
  font-weight: 800;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--ted-red);
  color: #fff;
  box-shadow: 0 4px 20px var(--ted-red-glow);
}

.btn-primary:hover {
  background: var(--ted-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(235, 0, 40, 0.6);
}

.btn-secondary {
  background: var(--surface-subtle);
  color: var(--text-main);
  border: 1.5px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--surface-elevated);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

html[dir="rtl"] .toast-container {
  right: auto;
  left: 2rem;
}

.toast {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.95rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 400px;
  animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error {
  border-color: #ef4444;
  background: #450a0a;
}

.toast.success {
  border-color: #10b981;
  background: #064e3b;
}

@keyframes toastSlide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Footer */
.site-footer {
  background: #04060a;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 2.5rem 0;
  font-size: 0.88rem;
  text-align: center;
  margin-top: auto;
}

.mobile-stepper-bar {
  display: none;
}

/* ==========================================================================
   Responsive Adaptations & Mobile Optimization
   ========================================================================== */

/* Tablet & Medium Screens (<= 768px) */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1.25rem;
  }
  .card-container {
    padding: 2rem 1.5rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .teams-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* Mobile & Small Screens (<= 640px) */
@media (max-width: 640px) {
  /* Language Gate on Mobile (Zero Cut-Off & Perfectly Centered) */
  .lang-gate-overlay {
    padding: max(0.75rem, env(safe-area-inset-top, 0.75rem)) 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0.75rem)) 0.75rem;
    align-items: center;
  }

  .lang-gate-card {
    padding: 1.4rem 1.15rem;
    border-radius: 18px;
    max-height: calc(100dvh - 1.5rem);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 30px -8px var(--ted-red-glow);
  }

  .lang-gate-badge {
    margin-bottom: 0.65rem;
    font-size: 0.72rem;
    padding: 0.22rem 0.65rem;
  }

  .lang-logo-wrapper {
    padding: 6px 16px;
    margin-bottom: 0.75rem;
    border-radius: 8px;
  }

  .lang-gate-logo {
    height: 32px !important;
  }

  .lang-gate-title {
    font-size: 1.3rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.3 !important;
  }

  .lang-gate-desc {
    font-size: 0.82rem !important;
    margin-bottom: 1.15rem !important;
  }

  .lang-cards-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
  }

  .lang-choice-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    text-align: right !important;
    padding: 0.8rem 1rem !important;
    gap: 0.85rem !important;
    border-radius: 12px !important;
    min-height: 64px !important;
  }

  html[dir="ltr"] .lang-choice-card {
    text-align: left !important;
  }

  .lang-choice-icon {
    width: 40px !important;
    height: 40px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
  }

  .lang-choice-info {
    text-align: right !important;
    flex: 1 !important;
  }

  html[dir="ltr"] .lang-choice-info {
    text-align: left !important;
  }

  .lang-choice-name {
    font-size: 1.12rem !important;
    margin-bottom: 0.1rem !important;
  }

  .lang-choice-sub {
    font-size: 0.74rem !important;
    line-height: 1.35 !important;
  }

  /* Header on Mobile */
  .header-container {
    padding: 0 1rem;
  }

  .brand-logo-img {
    height: 32px;
  }

  .header-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
  }

  .theme-toggle-btn {
    width: 34px;
    height: 34px;
    padding: 0.4rem;
  }

  /* Stepper on Mobile (Adaptive Clean Bar) */
  .desktop-stepper {
    display: none !important;
  }

  .stepper-nav {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 14px;
  }

  .mobile-stepper-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .mobile-step-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.84rem;
  }

  .mobile-step-counter {
    font-weight: 700;
    color: var(--ted-red);
  }

  .mobile-step-name {
    font-weight: 800;
    color: var(--text-main);
  }

  .mobile-progress-track {
    width: 100%;
    height: 5px;
    background: var(--surface-subtle);
    border-radius: 4px;
    overflow: hidden;
  }

  .mobile-progress-fill {
    height: 100%;
    background: var(--ted-red);
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--ted-red-glow);
  }

  /* Main Wrapper & Cards on Mobile */
  .main-wrapper {
    padding: 0 0.85rem;
    margin: 1rem auto 2rem;
  }

  .card-container {
    padding: 1.35rem 1rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
  }

  .section-header {
    margin-bottom: 1.35rem;
    padding-bottom: 0.85rem;
  }

  .section-title {
    font-size: 1.35rem;
    line-height: 1.3;
  }

  .section-desc {
    font-size: 0.86rem;
    margin-top: 0.3rem;
  }

  /* Intro Section on Mobile */
  .intro-hero {
    margin-bottom: 1.5rem;
  }

  .intro-badge {
    font-size: 0.78rem;
    padding: 0.3rem 0.85rem;
    margin-bottom: 0.75rem;
  }

  .intro-title {
    font-size: 1.65rem;
    margin-bottom: 0.65rem;
  }

  .intro-lead {
    font-size: 0.98rem;
    margin-bottom: 0.75rem;
  }

  .intro-body-text {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .highlights-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 1.5rem 0;
  }

  .highlight-card {
    padding: 1.15rem 1rem;
    border-radius: 12px;
  }

  .highlight-icon-box {
    width: 40px;
    height: 40px;
    margin-bottom: 0.65rem;
  }

  .highlight-title {
    font-size: 1.05rem;
  }

  .highlight-desc {
    font-size: 0.85rem;
  }

  /* Form Controls on Mobile */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-group {
    margin-bottom: 1.15rem;
  }

  .form-input, .form-select, .form-textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS */
    padding: 0.8rem 0.9rem;
    min-height: 48px;
    border-radius: 10px;
  }

  .form-label {
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
  }

  .conditional-panel {
    padding: 1.1rem 0.85rem;
    border-radius: 12px;
    margin: 1rem 0 1.25rem;
  }

  .conditional-title {
    font-size: 0.98rem;
    margin-bottom: 0.85rem;
  }

  /* Teams Grid on Mobile */
  .teams-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
  }

  .team-card {
    padding: 1.15rem 1rem;
    border-radius: 14px;
  }

  .team-icon-circle {
    width: 42px;
    height: 42px;
    margin-bottom: 0.75rem;
  }

  .team-name {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
  }

  .team-description {
    font-size: 0.84rem;
    line-height: 1.45;
    margin-bottom: 1rem;
  }

  .btn-select-team {
    min-height: 44px;
    font-size: 0.88rem;
  }

  /* Radio Cards on Mobile */
  .radio-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .radio-card {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    min-height: 48px;
  }

  .radio-card-text {
    font-size: 0.88rem;
  }

  /* Review Block on Mobile */
  .review-block {
    padding: 1.1rem 0.85rem;
    border-radius: 12px;
    margin-bottom: 1rem;
  }

  .review-block-title {
    font-size: 0.98rem;
  }

  .review-list {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .review-label {
    font-size: 0.76rem;
  }

  .review-value {
    font-size: 0.9rem;
  }

  .checkbox-card {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    margin-top: 1.25rem;
  }

  .checkbox-card-text {
    font-size: 0.86rem;
  }

  .privacy-box {
    font-size: 0.8rem;
    padding: 0.85rem 1rem;
    line-height: 1.5;
  }

  /* Form Action Buttons on Mobile */
  .form-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
  }

  .form-actions .btn {
    width: 100%;
    min-height: 48px;
    font-size: 0.98rem;
    padding: 0.85rem 1.25rem;
  }

  /* Success Card on Mobile */
  .success-card {
    padding: 2rem 1rem;
  }

  .success-badge-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
  }

  .success-badge-icon svg {
    width: 32px;
    height: 32px;
  }

  .success-title {
    font-size: 1.45rem;
  }

  .ref-code-box {
    padding: 1.25rem 1rem;
    margin: 1.25rem auto;
    border-radius: 12px;
  }

  .ref-code-value {
    font-size: 1.55rem;
    letter-spacing: 1px;
  }

  .btn-copy-ref {
    min-height: 44px;
    width: 100%;
    justify-content: center;
  }

  .important-box {
    padding: 0.85rem 1rem;
    font-size: 0.84rem;
  }
}

