:root {
  --primary: #4e54c8;
  --secondary: #8f94fb;
  --success: #38ef7d;
  --warning: #fbb040;
  --danger: #f85f40;
  --light: #f8f9fa;
  --dark: #343a40;
  --text: #2d3748;
  --text-light: #718096;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 30px 10px;
  color: var(--text);
}

.container {
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  padding: 30px 25px;
  max-width: 600px;
  width: 100%;
  animation: fadeIn 0.8s ease-in-out;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

@keyframes fadeIn {
  from {
      opacity: 0;
      transform: translateY(20px);
  }

  to {
      opacity: 1;
      transform: translateY(0);
  }
}

h2 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.8rem;
  position: relative;
  padding-bottom: 10px;
}

h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 50%;
  transform: translateX(50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

h3 {
  font-size: 1rem;
  line-height: 1.8;
  text-align: justify;
  color: var(--text);
  background-color: rgba(143, 148, 251, 0.1);
  padding: 15px;
  border-radius: 10px;
  border-right: 4px solid var(--primary);
  margin-bottom: 20px;
  position: relative;
}



label {
  display: block;
  margin-top: 20px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

label:hover {
  color: var(--primary);
}

select,
input {
  width: 100%;
  padding: 12px 15px;
  margin-top: 8px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: 'Vazirmatn', sans-serif;
  background-color: #f8fafc;
}

select:focus,
input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.2);
  background-color: white;
}

button {
  width: 100%;
  padding: 15px;
  margin-top: 25px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(78, 84, 200, 0.3);
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(78, 84, 200, 0.4);
}

button:active {
  transform: translateY(0);
}

button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

button:focus:not(:active)::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  0% {
      transform: scale(0, 0);
      opacity: 0.5;
  }

  100% {
      transform: scale(20, 20);
      opacity: 0;
  }
}

.footer {
  text-align: center;
  margin-top: 40px;
  font-size: 0.9rem;
  color: var(--text-light);
  width: 100%;
  max-width: 600px;
}

.footer a {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 20px;
  background-color: white;
  color: var(--primary);
  text-decoration: none;
  font-weight: bold;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--primary);
}

.footer a:hover {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(78, 84, 200, 0.3);
}

.footer p {
  margin-top: 20px;
}

/* مدال نتیجه */
.modal-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: white;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  padding: 30px;
  text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: all 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 15px;
  left: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  color: var(--primary);
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--primary);
}

.modal-text {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 20px;
  color: var(--text);
}

.modal-btn {
  padding: 10px 25px;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(78, 84, 200, 0.3);
}

.modal-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(78, 84, 200, 0.4);
}

/* انیمیشن مدال موفقیت */
@keyframes bounceIn {
  0% {
      transform: scale(0.5);
      opacity: 0;
  }

  60% {
      transform: scale(1.1);
      opacity: 1;
  }

  100% {
      transform: scale(1);
  }
}

.success .modal-icon {
  color: var(--success);
  animation: bounceIn 0.6s ease;
}

.warning .modal-icon {
  color: var(--warning);
  animation: bounceIn 0.6s ease;
}

.error .modal-icon {
  color: var(--danger);
  animation: bounceIn 0.6s ease;
}

/* افکت برای آیتم‌ها */
.form-item {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
      opacity: 0;
      transform: translateY(20px);
  }

  to {
      opacity: 1;
      transform: translateY(0);
  }
}

@media screen and (max-width: 480px) {
  .container {
      padding: 20px 15px;
  }

  h2 {
      font-size: 1.5rem;
  }

  h3 {
      font-size: 0.9rem;
      padding: 12px;
  }

  button {
      padding: 12px;
      font-size: 1rem;
  }
}