/* Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal.active .modal__content {
  transform: translateY(0);
}

.modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  width: 90%;
  max-width: 500px;
  margin: 50px auto;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .modal__content {
    margin: 20px auto;
    width: 95%;
    max-height: 95vh;
  }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 16px;
  border-bottom: 1px solid #F5F5F5;
}

.modal__header h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #000000;
  font-family: 'Inter', sans-serif;
}

.modal__close {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s ease;
  color: #989C99;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  background-color: #F5F5F5;
  color: #000000;
}

.modal__body {
  padding: 24px;
}

/* Form Styles */
.demo-form .form-group {
  margin-bottom: 20px;
}

.demo-form .form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #000000;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.demo-form .form-group .field {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #C2CDD7;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.2s ease;
  background: #ffffff;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

.demo-form .form-group .field:focus {
  outline: none;
  border-color: #909B00;
  box-shadow: 0 0 0 3px rgba(144, 155, 0, 0.1);
}

.demo-form .form-group .field:invalid:not(:placeholder-shown) {
  border-color: #fb3030;
  box-shadow: 0 0 0 3px rgba(251, 48, 48, 0.1);
}

/* Estados de validación personalizados */
.demo-form .form-group .field.valid,
.field.valid {
  border-color: #11e333;
  box-shadow: 0 0 0 3px rgba(17, 227, 51, 0.1);
  background-color: rgba(17, 227, 51, 0.02);
}

.demo-form .form-group .field.invalid,
.field.invalid {
  border-color: #fb3030;
  box-shadow: 0 0 0 3px rgba(251, 48, 48, 0.1);
  background-color: rgba(251, 48, 48, 0.02);
}

/* Mensaje de error */
.form-group .error-message {
  color: #fb3030;
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

.form-group .field.invalid + .error-message {
  display: block;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

@media (max-width: 500px) {
  .form-actions {
    flex-direction: column;
  }
}

.form-actions .button--tertiary {
  background: transparent;
  border: 1px solid #C2CDD7;
  color: #989C99;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
  font-family: 'Inter', sans-serif;
}

.form-actions .button--tertiary:hover {
  background: #F5F5F5;
  border-color: #B9BCBA;
}

.form-actions .button--secondary {
  flex: 1;
  margin: 0;
}

/* Mensajes de formulario */
.form-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.form-message.error {
  background-color: rgba(251, 48, 48, 0.1);
  border: 1px solid rgba(251, 48, 48, 0.3);
  color: #fb3030;
}

.form-message.success {
  background-color: rgba(17, 227, 51, 0.1);
  border: 1px solid rgba(17, 227, 51, 0.3);
  color: #11e333;
}

/* Estados de botón deshabilitado */
.button--secondary:disabled,
.button--tertiary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}