@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;700&display=swap');

:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
}

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

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    direction: rtl;
}

.form-container {
    font-family: 'Vazirmatn', sans-serif;
    background-color: white;
    margin: 25px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    animation: fadeIn 1s ease-in-out;
}

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

form {
    display: flex;
    flex-direction: column;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
    animation: slideIn 0.5s ease-in-out forwards;
    opacity: 0;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

fieldset:nth-of-type(1) { animation-delay: 0.1s; }
fieldset:nth-of-type(2) { animation-delay: 0.2s; }
fieldset:nth-of-type(3) { animation-delay: 0.3s; }
fieldset:nth-of-type(4) { animation-delay: 0.4s; }
fieldset:nth-of-type(5) { animation-delay: 0.5s; }
fieldset:nth-of-type(6) { animation-delay: 0.6s; }


legend {
    padding: 0 10px;
    font-weight: 700;
    color: var(--primary-color);
}

.input-group {
    margin-bottom: 15px;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 400;
}

input[type="text"],
input[type="tel"],
input[type="email"],
select,
textarea {
    font-family: 'Vazirmatn', sans-serif;
    width: 100%;
    padding: 7.5px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(74, 144, 226, 0.5);
}

input:required:invalid {
    border-color: var(--error-color);
}

input:required:valid {
    border-color: var(--success-color);
}

button[type="submit"] {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.3s;
}

button[type="submit"]:hover {
    background-color: #3a7ac8;
    transform: translateY(-2px);
}

.form-title {
    font-family: 'Vazirmatn', sans-serif;
    text-align: center;
    margin-bottom: 30px;
    font-size: 25px;
    font-weight: 700;
    animation: titleAnimation 0.8s ease-out backwards;
    animation-delay: 0.2s;
}


.custom-checkbox {
  display: block;
  position: relative;
  padding-right: 25px;
  margin-bottom: 12.5px;
  cursor: pointer;
  font-size: 14px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide the browser's default checkbox */
.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

/* Create a custom checkbox */
.checkmark {
  position: absolute;
  top: 0;
  right: 0;
  height: 20px;
  width: 20px;
  background-color: #eee;
  border: 1px solid #ccc;
  border-radius: 5px;
  transition: background-color 0.3s;
}

/* On mouse-over, add a grey background color */
.custom-checkbox:hover input ~ .checkmark {
  background-color: #ccc;
}

/* When the checkbox is checked, add a blue background */
.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

/* Show the checkmark when checked */
.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

/* Style the checkmark/indicator */
.custom-checkbox .checkmark:after {
  left: 5px;
  top: 1px;
  bottom: 1px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
}

.custom-checkbox a {
  color: var(--primary-color);
  text-decoration: none;
}

.custom-checkbox a:hover {
  text-decoration: underline;
}