/* ===========================
   General Page Layout
=========================== */
body {
  font-family: IRANYekan, sans-serif;
  font-weight: 300;
  direction: rtl;
  text-align: right;
  background-color: #f9f9f9;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 900px;
  margin: 50px auto;
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.1);
}

/* ===========================
   Form Layout
=========================== */
form {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.form-group {
  width: 48%;
  margin-bottom: 20px;
}

.form-group.full-width {
  width: 100%;
}

label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: #333;
}

/* mark required field asterisks in red */
.required-star {
  color: #d32f2f; /* red */
  margin-left: 4px;
}

input[type="text"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 15px;
  /* ensure inputs inherit the page's default body font */
  font-family: inherit;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ===========================
   Captcha Section
=========================== */
.captcha-container {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 45px;
}

.captcha-img {
  height: 100%;
  width: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
}

#refresh-captcha {
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s;
}

#refresh-captcha:hover {
  background: #ddd;
}

/* ===========================
   Submit Button
=========================== */
button[type="submit"] {
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 30px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  /* inherit the page font so button text matches other inputs */
  font-family: inherit;
}

/* ensure other button-like controls also inherit the body font */
button, input[type="submit"], input[type="button"] {
  font-family: inherit;
}

button[type="submit"]:hover {
  background-color: #0056b3;
}

/* ===========================
   Responsive Design
=========================== */
@media (max-width: 768px) {
  .form-group {
    width: 100%;
  }
  .captcha-container {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
  }
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 90vw;
  background: #fff;
  color: #222;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.toast.success { border-left: 6px solid #4caf50; }
.toast.error { border-left: 6px solid #f44336; }
.toast .close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
}
