/* ===================================
       انضم إلى فريق دالّة
   =================================== */

/* Hero Section */
.join-hero {
  background: linear-gradient(135deg, #062141, #0a4d4d);
  color: #fff;
  padding: 140px 20px 80px; /* ✅ Fixed: increased from 100px to 140px to clear navbar */
  text-align: center;
  position: relative;
  overflow: hidden;
}

.join-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
  animation: float 20s linear infinite;
}

@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-100px); }
}

.join-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

/* Hero Icon */
.join-hero .hero-icon {
  font-size: 70px;
  margin-bottom: 22px;
}

/* Hero Title */
.join-hero h1 {
  font-size: 56px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Paragraph */
.join-hero p {
  font-size: 20px;
  line-height: 1.8;
  color: #e6f1f4;
  max-width: 800px;
  margin: 0 auto;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Form Section */
.join-form-section {
  padding: 80px 20px;
  background: linear-gradient(to bottom, #f5f7f9, #ffffff);
}

.join-form-wrap {
  max-width: 1000px;
  margin: 0 auto;
}

/* Form Cards */
.form-card {
  background: #ffffff;
  padding: 40px;
  margin-bottom: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(6, 33, 65, 0.08);
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-card.visible {
  opacity: 1;
  transform: translateX(0);
}

.form-card:hover {
  box-shadow: 0 15px 40px rgba(6, 33, 65, 0.12);
  transform: translateY(-5px) scale(1.01);
}

/* ✅ Fixed: Removed the conflicting .loading { opacity: 0 } rule.
   The form-card already manages its own opacity via the .visible class.
   The old .loading class was keeping cards invisible even when in viewport. */

/* Form Section Title */
.form-section-title {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 25px;
  color: #062141;
  position: relative;
  display: inline-block;
}

.form-section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(to left, #0a4d4d, #062141);
  transition: width 0.6s ease;
}

.form-card.visible .form-section-title::after {
  width: 100%;
}

.form-description {
  font-size: 16px;
  color: #666;
  margin-bottom: 25px;
  font-style: italic;
}

/* Form Elements */
.join-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-weight: 700;
  color: #062141;
  margin-bottom: 10px;
  font-size: 16px;
}

.form-group label .required {
  color: #ef4444;
  margin-right: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-family: "Tajawal", sans-serif;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
  color: #062141;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0a4d4d;
  box-shadow: 0 0 0 3px rgba(10, 77, 77, 0.1);
  transform: translateY(-2px);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: #0a4d4d;
}

/* Select Dropdown */
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L7 7L13 1' stroke='%23062141' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 20px center;
  padding-left: 45px;
}

/* Textarea */
.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.char-counter {
  display: block;
  text-align: left;
  font-size: 13px;
  color: #999;
  margin-top: 8px;
  font-weight: 500;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.checkbox-item:hover {
  border-color: #0a4d4d;
  background: #f8fafc;
  transform: translateX(-4px);
  box-shadow: 0 4px 12px rgba(6, 33, 65, 0.08);
}

.checkbox-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
  appearance: none;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
  background: #ffffff;
}

.checkbox-item input[type="checkbox"]:hover {
  border-color: #0a4d4d;
  transform: scale(1.1);
}

.checkbox-item input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #062141, #0a4d4d);
  border-color: #062141;
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
  border-color: #0a4d4d;
  background: linear-gradient(135deg, rgba(6, 33, 65, 0.05), rgba(10, 77, 77, 0.05));
  box-shadow: 0 4px 12px rgba(6, 33, 65, 0.12);
}

.checkbox-label {
  font-size: 16px;
  color: #334155;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}

.checkbox-item:has(input[type="checkbox"]:checked) .checkbox-label {
  color: #062141;
  font-weight: 600;
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 18px 40px;
  background: linear-gradient(135deg, #062141, #0a4d4d);
  color: white;
  font-size: 20px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(6, 33, 65, 0.2);
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.submit-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.submit-btn:hover::before {
  width: 400px;
  height: 400px;
}

.submit-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(6, 33, 65, 0.3);
}

.submit-btn:active {
  transform: translateY(-2px);
}

.btn-arrow {
  font-size: 24px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.submit-btn:hover .btn-arrow {
  transform: translateX(-6px);
  animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(-6px); }
  50% { transform: translateX(-10px); }
}

/* Success Card */
.success-card {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  padding: 35px 40px;
  margin-bottom: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
  border: 2px solid #6ee7b7;
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

.success-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.success-card h3 {
  font-size: 28px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 15px;
}

.success-card p {
  font-size: 18px;
  color: #047857;
  line-height: 1.7;
  margin: 0;
}

/* Error States */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #ef4444;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.error-message {
  color: #ef4444;
  font-size: 14px;
  margin-top: 8px;
  font-weight: 500;
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .join-hero {
    padding: 128px 15px 60px;
  }

  .join-hero h1 {
    font-size: 30px;
  }

  .join-hero p {
    font-size: 18px;
  }

  .form-section-title {
    font-size: 30px;
  }

  .form-card {
    padding: 30px 25px;
  }

  .checkbox-group {
    padding: 20px;
    gap: 14px;
  }

  .checkbox-item {
    padding: 12px 16px;
  }

  .checkbox-label {
    font-size: 15px;
  }

  .submit-btn {
    font-size: 18px;
    padding: 16px 30px;
  }
}

@media (max-width: 480px) {
  .join-hero {
    padding: 128px 15px 60px;
  }

  .join-hero h1 {
    font-size: 30px;
  }

  .join-hero p {
    font-size: 16px;
  }

  .form-section-title {
    font-size: 26px;
  }

  .form-card {
    padding: 25px 20px;
  }

  .checkbox-group {
    padding: 18px;
  }

  .checkbox-item {
    padding: 12px 14px;
  }

  .checkbox-label {
    font-size: 14px;
  }

  .checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  .submit-btn {
    font-size: 17px;
    padding: 15px 25px;
  }
}

/* Additional Animations */
.form-group {
  animation: slideIn 0.5s ease-out backwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-group:nth-child(4) { animation-delay: 0.25s; }
.form-group:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Character Counter Colors */
.char-counter.warning {
  color: #f59e0b;
}

.char-counter.danger {
  color: #ef4444;
}