/* انضم إلينا — تصميم احترافي */
.join-page,
.join-page *,
.join-page *::before,
.join-page *::after {
  box-sizing: border-box;
}

:root {
  --gold: #c9a227;
  --gold-soft: #f0d78a;
  --gold-dim: rgba(201, 162, 39, 0.14);
  --bg0: #030a07;
  --bg1: #071510;
  --bg2: #0c1f16;
  --card: rgba(12, 32, 24, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-gold: rgba(201, 162, 39, 0.28);
  --text: #f2f6f0;
  --muted: #a8b5ac;
  --success: #2ecc71;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.join-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 48px;
  padding-top: 8px;
}

/* Hero */
.join-hero {
  position: relative;
  padding: 40px 36px 36px;
  margin-bottom: 28px;
  border-radius: 28px;
  border: 1px solid var(--line-gold);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(201, 162, 39, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(46, 120, 80, 0.12), transparent 50%),
    linear-gradient(165deg, rgba(14, 36, 26, 0.98), rgba(5, 14, 10, 0.99));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.join-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.join-hero-inner { position: relative; z-index: 1; }

.join-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid var(--line-gold);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.join-hero h1 {
  margin: 18px 0 12px;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.join-hero-lead {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.95;
}

/* Journey */
.journey {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.journey-step {
  padding: 16px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  text-align: center;
}

.journey-step .num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--line-gold);
  color: var(--gold-soft);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
}

.journey-step strong {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}

.journey-step span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}

.journey-step.is-highlight {
  border-color: var(--line-gold);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.12), rgba(255, 255, 255, 0.02));
}

/* Path selection */
.path-section {
  margin-bottom: 24px;
}

.path-section-head {
  margin-bottom: 18px;
}

.path-section-head h2 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 900;
}

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

.path-group-label {
  margin: 20px 0 12px;
  font-size: 12px;
  font-weight: 900;
  color: var(--gold-soft);
  letter-spacing: 0.06em;
}

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

.path-card {
  text-align: right;
  padding: 18px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  color: inherit;
}

.path-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 162, 39, 0.35);
}

.path-card.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.16), rgba(255, 255, 255, 0.03));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.path-card.featured {
  grid-column: span 1;
  border-color: rgba(201, 162, 39, 0.4);
}

.path-card .path-icon {
  font-size: 26px;
  margin-bottom: 10px;
  line-height: 1;
}

.path-card .path-title {
  display: block;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 6px;
}

.path-card .path-desc {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.path-card .path-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.28);
  color: #b8f5d0;
  font-size: 11px;
  font-weight: 800;
}

.path-card.featured .path-tag {
  background: var(--gold-dim);
  border-color: var(--line-gold);
  color: var(--gold-soft);
}

/* Form shell */
.form-shell {
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0.6;
  transform: translateY(8px);
  transition: opacity 0.35s, transform 0.35s;
}

.form-shell.visible {
  opacity: 1;
  transform: none;
}

.form-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.form-shell-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.form-shell-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.active-path-badge {
  padding: 10px 16px;
  border-radius: 14px;
  background: var(--gold-dim);
  border: 1px solid var(--line-gold);
  font-size: 13px;
  font-weight: 800;
  color: var(--gold-soft);
  white-space: nowrap;
}

.active-path-badge em {
  font-style: normal;
  color: var(--text);
}

.join-form { padding: 24px; display: grid; gap: 20px; }

.section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
}

.section-title {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 900;
}

.join-page .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
  width: 100%;
}

.join-page .field {
  display: grid;
  gap: 7px;
  min-width: 0;
  width: 100%;
}

.join-page .field.full {
  grid-column: 1 / -1;
}

/* توافق إن وُجدت class grid بدون join-page */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
  width: 100%;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  width: 100%;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 13px;
  font-weight: 800;
  color: #e8eeea;
}

.req { color: var(--gold-soft); }

.join-page input,
.join-page select,
.join-page textarea,
.join-form input,
.join-form select,
.join-form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 15px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px 15px;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

select option { background: #0f2219; }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

textarea { min-height: 110px; resize: vertical; }

.type-panel { display: none; }
.type-panel.active { display: block; }

.policy-note {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line-gold);
  background: var(--gold-dim);
  color: #dce8e0;
  font-size: 13px;
  line-height: 1.85;
  font-weight: 700;
  margin-bottom: 16px;
}

.staff-arch-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.arch-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  background: rgba(0, 0, 0, 0.15);
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}

.arch-card strong {
  display: block;
  color: var(--gold-soft);
  margin-bottom: 6px;
  font-size: 13px;
}

.picker-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 900;
  color: var(--gold-soft);
}

.domain-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.domain-tile {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  text-align: center;
  transition: 0.2s;
}

.domain-tile:hover { border-color: rgba(201, 162, 39, 0.4); }

.domain-tile.active {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.domain-tile-label {
  display: block;
  font-size: 13px;
  font-weight: 900;
}

.domain-tile-count {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}

.role-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.role-chip {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.18s;
}

.role-chip:hover { border-color: rgba(201, 162, 39, 0.4); }

.role-chip.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.25), rgba(201, 162, 39, 0.08));
  color: #fff8dc;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.age-banner {
  display: none;
  padding: 14px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.85;
  margin-bottom: 12px;
}

.age-banner.minor {
  border: 1px solid rgba(108, 168, 255, 0.3);
  background: rgba(108, 168, 255, 0.08);
  color: #d6e6ff;
}

.age-banner.adult {
  border: 1px solid rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.08);
  color: #d4ffe4;
}

.field-hint,
.hijri-today-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}

.guardian-goals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.goal-btn {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}

.goal-btn.active {
  border-color: var(--gold);
  background: var(--gold-dim);
  color: var(--gold-soft);
}

.member-interests {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.interest-chip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.interest-chip input { width: 18px; accent-color: var(--gold); margin-top: 2px; }

.policy-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.policy-row {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.field-inline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--muted);
}

.submit-zone {
  text-align: center;
}

.consent-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 20px auto 24px;
  padding: 16px 22px;
  border-radius: 16px;
  border: 1px solid var(--line-gold);
  background: rgba(201, 162, 39, 0.08);
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  max-width: 520px;
}

.consent-card input {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}

.submit-center {
  display: flex;
  justify-content: center;
  margin: 8px 0 20px;
}

.submit-btn-hero {
  width: min(100%, 420px);
  min-height: 58px;
  font-size: 18px;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 36px rgba(201, 162, 39, 0.28);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  justify-content: center;
}

.action-row-secondary {
  opacity: 0.92;
}

.action-row-secondary .ghost-btn {
  min-height: 44px;
  font-size: 14px;
}

.join-closed-banner {
  display: none;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(197, 82, 82, 0.35);
  background: rgba(197, 82, 82, 0.12);
  color: #ffd7d7;
  font-weight: 800;
  line-height: 1.8;
  text-align: center;
}

.join-closed-banner.show {
  display: block;
}

.path-card.is-closed {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.4);
}

.submit-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 15px 24px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 900;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: transform 0.2s;
}

.submit-btn {
  background: linear-gradient(180deg, #e4c36f, #c9a227);
  color: #1a1205;
  min-width: 200px;
}

.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.submit-btn:hover,
.ghost-btn:hover { transform: translateY(-2px); }

.player-suggestions {
  display: none;
  margin-top: 6px;
  border: 1px solid var(--line-gold);
  border-radius: 14px;
  overflow: hidden;
}

.player-suggestions.show { display: block; }

.player-suggestion {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #fff;
  font-family: inherit;
  text-align: right;
  cursor: pointer;
}

.selected-players { display: none; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.selected-players.show { display: flex; }

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--gold-dim);
  border: 1px solid var(--line-gold);
  font-size: 13px;
}

.toast-wrap {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 16px;
  border-radius: 14px;
  background: #0f2219;
  border: 1px solid var(--line);
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.toast.success { border-color: rgba(46, 204, 113, 0.35); color: #ccffdf; }
.toast.warn { border-color: rgba(201, 162, 39, 0.4); color: #ffe79c; }
.toast.error { border-color: rgba(255, 107, 107, 0.35); color: #ffd7d7; }

@media (max-width: 900px) {
  .journey { grid-template-columns: repeat(2, 1fr); }
  .path-grid { grid-template-columns: repeat(2, 1fr); }
  .domain-tiles { grid-template-columns: repeat(3, 1fr); }
  .staff-arch-note { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .join-page { width: calc(100% - 16px); }
  .join-hero { padding: 24px 18px; }
  .journey { grid-template-columns: 1fr; }
  .path-grid { grid-template-columns: 1fr; }
  .join-page .grid,
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .domain-tiles { grid-template-columns: repeat(2, 1fr); }
  .guardian-goals { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .domain-tiles { grid-template-columns: 1fr; }
  .domain-tile { min-height: 48px; padding: 16px; }
  .action-row-secondary .ghost-btn { width: 100%; }
  .submit-btn { min-width: 0; width: 100%; }
  .submit-btn-hero { width: 100%; }
}

.join-page button,
.join-page .btn,
.join-page input,
.join-page select,
.join-page textarea {
  min-height: 48px;
}
