.auth-container {
  width: 100%;
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  align-items: stretch;
  gap: 2rem;
  margin: 4rem auto;
  max-width: 1400px;
  padding: 0 2rem;
}

.auth-container img {
  width: 100%;
  height: 100%;
  max-height: 85vh;
  min-height: 500px;
  justify-self: center;
  align-self: center;
  object-fit: cover;
  border-radius: 15px;
}
form {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: #fff;
  padding: 3rem 4rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}
form h1 {
  color: var(--y-main);
  font-weight: 600;
  margin-bottom: 3rem;
  text-align: center;
}

label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 1.2rem;
}
input {
  padding: 0.8rem;
  margin: 0 0 1.3rem 0;
  border: 1px solid #2e2e2e;
  border-radius: 20px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  background: rgba(255, 255, 255, 0.9);
}

input:focus {
  border-color: var(--y-secondary);
  box-shadow: 0 0 0 3px rgba(190, 134, 71, 0.1),
    0 4px 12px rgba(190, 134, 71, 0.15);
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

input:hover {
  border-color: rgba(190, 134, 71, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
div.checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  margin-left: 5rem;
  font-size: 1rem;
  font-weight: 500;
}

label.checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  margin-left: 5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  position: relative;
}

label.checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

label.checkbox .checkmark {
  height: 20px;
  width: 20px;
  background-color: #eee;
  border-radius: 4px;
  border: 1px solid #2e2e2e;
  margin-left: 0.5rem;
  box-sizing: border-box;
}

label.checkbox:hover input ~ .checkmark {
  background-color: #ccc;
}

label.checkbox input:checked ~ .checkmark {
  background-color: #333;
  border-color: #333;
}

label.checkbox .checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

label.checkbox input:checked ~ .checkmark:after {
  display: block;
}

label.checkbox .checkmark:after {
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* رسائل المصادقة: خطأ / نجاح */
.y-c-auth-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.5;
  text-align: right;
  border: 1px solid transparent;
}

.y-c-auth-message__icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
}

.y-c-auth-message__text {
  flex: 1;
}

.y-c-auth-message--error {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.3);
  color: #b02a37;
}

.y-c-auth-message--error .y-c-auth-message__icon {
  color: #dc3545;
}

.y-c-auth-message--success {
  background: rgba(25, 135, 84, 0.08);
  border-color: rgba(25, 135, 84, 0.3);
  color: #0f5132;
}

.y-c-auth-message--success .y-c-auth-message__icon {
  color: #198754;
}

/* الجوال: أحجام خطوط أصغر لصفحات المصادقة (تسجيل، دخول، نسيت/إنشاء كلمة المرور) */
@media (max-width: 820px) {
  .auth-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
    align-items: center;
  }

  .auth-container img {
    width: 100%;
    height: auto;
    min-height: auto;
    order: 1;
  }

  .form {
    order: 2;
  }

  form {
    height: auto;
    min-height: auto;
    justify-content: flex-start;
    max-width: none;
    padding: 1.25rem 1rem;
  }

  form h1 {
    text-align: center;
    font-size: 1.35rem;
    margin-bottom: 1.5rem;
  }

  form label {
    font-size: 0.95rem;
  }

  form label.checkbox,
  form .checkbox {
    font-size: 0.9rem;
    margin-left: 0;
  }

  form p {
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
  }

  .y-c-auth-message {
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  .y-c-auth-message__icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  form a {
    font-size: 0.9rem;
  }

  input {
    font-size: 0.9rem;
    padding: 0.6rem 0.75rem;
    margin: 0 0 1rem 0;
  }

  .btn-auth,
  form .button,
  form button[type="submit"] {
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
  }
}

@media (max-width: 480px) {
  form {
    padding: 1rem 0.75rem;
  }

  form h1 {
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
  }

  form label {
    font-size: 0.875rem;
  }

  form label.checkbox,
  form .checkbox {
    font-size: 0.85rem;
  }

  form p,
  form a {
    font-size: 0.85rem;
  }

  input {
    font-size: 0.85rem;
    padding: 0.5rem 0.65rem;
  }

  .btn-auth,
  form .button,
  form button[type="submit"] {
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 40px 30px;
  text-align: center;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
  transform: translateY(0);
}

.modal-icon {
  font-size: 4rem;
  color: #4caf50;
  margin-bottom: 20px;
}

.modal-content h2 {
  color: var(--y-secondary);
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.modal-content p {
  color: #666;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 30px;
}

.modal-content .btn-primary {
  background: var(--y-secondary);
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.modal-content .btn-primary:hover {
  background: var(--y-color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(164, 130, 93, 0.3);
}

@media (max-width: 480px) {
  .modal-content {
    padding: 30px 20px;
    max-width: 350px;
  }

  .modal-icon {
    font-size: 3rem;
  }

  .modal-content h2 {
    font-size: 1.5rem;
  }

  .modal-content p {
    font-size: 0.9rem;
  }
}
